Re: [R] Dataframe Manipulation

2017-09-05 Thread Ulrik Stervbo
rrected these things by hand in the example data. >>>>> >>>>> HTH >>>>> Ulrik >>>>> >>>>> On Wed, 30 Aug 2017 at 10:16 Hemant Sain >>>>> wrote: >>>>> >>>>>> Hey PIKAL, >&

Re: [R] Dataframe Manipulation

2017-09-04 Thread Hemant Sain
;>>>> my company so that i can share the original data file, Actually I'm >>>>> working >>>>> on a market basket analysis task but not able to convert my existing >>>>> data >>>>> table to appropriate format so that i can apply Apriori

Re: [R] Dataframe Manipulation

2017-08-31 Thread Ulrik Stervbo
; R, >>>> and this is very important me to get it done because I'm an intern and >>>> if i >>>> won't get it done they will not going to hire me as a full-time >>>> employee. >>>> i tried everything by myself but not able to

Re: [R] Dataframe Manipulation

2017-08-30 Thread Hemant Sain
ave mentioned . >>> >>> Thanks >>> >>> On 30 August 2017 at 12:49, PIKAL Petr wrote: >>> >>> > Hi >>> > >>> > It seems to me like homework, there is no homework policy on this help >>> > list. >>> &g

Re: [R] Dataframe Manipulation

2017-08-30 Thread Ulrik Stervbo
uger does not match sugar (I wonder that sugar is dairy product) > > > > and you mix uppercase and lowercase letters which could be also > > problematic, when matching words. > > > > Cheers > > Petr > > > > > -Original Message- > > > Fro

Re: [R] Dataframe Manipulation

2017-08-30 Thread Hemant Sain
; and you mix uppercase and lowercase letters which could be also > problematic, when matching words. > > Cheers > Petr > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Hemant > Sain > > Sent: Wednesday, August

Re: [R] Dataframe Manipulation

2017-08-30 Thread PIKAL Petr
> Sent: Wednesday, August 30, 2017 8:28 AM > To: r-help@r-project.org > Subject: [R] Dataframe Manipulation > > i want to do a market basket analysis and I’m trying to create a dataset for > that > i have two tables, one table contains daily transaction of products in which >

[R] Dataframe Manipulation

2017-08-30 Thread Hemant Sain
i want to do a market basket analysis and I’m trying to create a dataset for that i have two tables, one table contains daily transaction of products in which each row of table shows item purchased by the customer, The second table contains parent group under those products are fallen, for example

Re: [R] dataframe manipulation

2013-12-13 Thread arun
Hi, Try:  d[match(unique(d$fac),d$fac),] A.K. On Friday, December 13, 2013 4:17 PM, Gang Chen wrote: Suppose I have a dataframe defined as     L3 <- LETTERS[1:3]     (d <- data.frame(cbind(x = 1, y = 1:10), fac = sample(L3, 10, replace = TRUE)))   x  y fac 1  1  1  C 2  1  2  A 3  1  3 

Re: [R] dataframe manipulation

2013-12-13 Thread William Dunlap
-project.org] On > Behalf > Of Gang Chen > Sent: Friday, December 13, 2013 1:35 PM > To: arun > Cc: R help > Subject: Re: [R] dataframe manipulation > > Perfect! Thanks a lot, A.K! > > > On Fri, Dec 13, 2013 at 4:21 PM, arun wrote: > > > > >

Re: [R] dataframe manipulation

2013-12-13 Thread Gang Chen
Another neat solution! Thanks a lot, Sarah! On Fri, Dec 13, 2013 at 4:35 PM, Sarah Goslee wrote: > What about: > > lapply(levels(d$fac), function(x)head(d[d$fac == x,], 1)) > > > Thanks for the reproducible example. If you put set.seed(123) before > the call to sample, then everyone who tries it

Re: [R] dataframe manipulation

2013-12-13 Thread Sarah Goslee
What about: lapply(levels(d$fac), function(x)head(d[d$fac == x,], 1)) Thanks for the reproducible example. If you put set.seed(123) before the call to sample, then everyone who tries it will get the same data frame d. Sarah On Fri, Dec 13, 2013 at 4:15 PM, Gang Chen wrote: > Suppose I have a

Re: [R] dataframe manipulation

2013-12-13 Thread Gang Chen
Perfect! Thanks a lot, A.K! On Fri, Dec 13, 2013 at 4:21 PM, arun wrote: > > > Hi, > Try: > d[match(unique(d$fac),d$fac),] > A.K. > > > On Friday, December 13, 2013 4:17 PM, Gang Chen > wrote: > Suppose I have a dataframe defined as > > L3 <- LETTERS[1:3] > (d <- data.frame(cbind(x

[R] dataframe manipulation

2013-12-13 Thread Gang Chen
Suppose I have a dataframe defined as L3 <- LETTERS[1:3] (d <- data.frame(cbind(x = 1, y = 1:10), fac = sample(L3, 10, replace = TRUE))) x y fac 1 1 1 C 2 1 2 A 3 1 3 B 4 1 4 C 5 1 5 B 6 1 6 B 7 1 7 A 8 1 8 A 9 1 9 B 10 1 10 A I want to extract

Re: [R] Dataframe manipulation

2013-03-30 Thread englishfellow
Fantastic, thanks alot for that! Take care. Adam. Date: Sat, 30 Mar 2013 01:14:49 -0700 From: ml-node+s789695n466289...@n4.nabble.com To: english.fel...@hotmail.com Subject: Re: Dataframe manipulation Hi Adam, I hope this is what you wanted: dat1<- read.csv("example.csv",sep="\t",s

Re: [R] Dataframe manipulation

2013-03-30 Thread arun
Hi Adam, I hope this is what you wanted: dat1<- read.csv("example.csv",sep="\t",stringsAsFactors=FALSE)  str(dat1) #'data.frame':    102 obs. of  5 variables: # $ species  : chr  "B. barbastrellus" "E. nilssonii" "H. savii" "M. alcathoe" ... # $ period   : chr  "dusk" "dusk" "dusk" "dusk" ... # $

Re: [R] Dataframe manipulation

2007-12-04 Thread Dimitris Rizopoulos
b: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: "David Winsemius" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 04, 2007 4:47 PM Subject: Re: [R] Dataframe manipulation &g

Re: [R] Dataframe manipulation

2007-12-04 Thread David Winsemius
e, testdata1, had been entirely coverted to NA's and str(df2) did not look data.frame-like. > is.data.frame(df2) [1] FALSE -- David Winsemius > > - Original Message - > From: "Antje" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sen

Re: [R] Dataframe manipulation

2007-12-04 Thread John Kane
See R-FAQ # 7-11 for the solution. Have a look at http://finzi.psych.upenn.edu/R/Rhelp02a/archive/98227.html for a discussion of this type of problem and ways to get around the issue. --- Antje <[EMAIL PROTECTED]> wrote: > Hello, > > can anybody help me with this problem? > I have a datafram

Re: [R] Dataframe manipulation

2007-12-04 Thread Dimitris Rizopoulos
: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: "Antje" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 04, 2007 11:46 AM

[R] Dataframe manipulation

2007-12-04 Thread Antje
Hello, can anybody help me with this problem? I have a dataframe, which contains its values as factors though I have numbers but it was read as factors with "scan". Now I would like to convert these columns (multiple) to a numeric format. # this example creates a similar situation testdata <-