Re: [R] Help with sub-setting

2020-05-25 Thread Jim Lemon
oops, that should have been: by(data$Z,data[,c("X","Y")],summary) Jim On Tue, May 26, 2020 at 9:00 AM Jim Lemon wrote: > > Hi Jamie, > Your seem to want some descriptive statistic applied to subsets of > your data frame "data" (maybe a more imaginative name would help). > I'll guess that your d

Re: [R] Help with sub-setting

2020-05-25 Thread Jim Lemon
Hi Jamie, Your seem to want some descriptive statistic applied to subsets of your data frame "data" (maybe a more imaginative name would help). I'll guess that your data frame contains variables X, Y and Z among others. Further, I'll guess that you want the summaries of variable Z subset by Y and X

Re: [R] Help with sub-setting

2020-05-25 Thread Rui Barradas
Hello, Inline. Às 13:26 de 25/05/20, Burgess, Jamie escreveu: Dear all, I hope this message finds you well. I am currently trying to subset my data by two variables, so far, I have tried two different ways to stratify participants into groups. I don't understand what you mean by this, do yo

Re: [R] [External] Help with sub-setting

2020-05-25 Thread Bert Gunter
Yes. In particular: data$variable==1 & data makes no sense (data is a data frame). A typo perhaps? Or as Richard indicated, consult references/tutorials to learn proper syntax for (vectorized) predicates. Bert Gunter "The trouble with having an open mind is that people keep coming along and sti

Re: [R] [External] Help with sub-setting

2020-05-25 Thread Richard M. Heiberger
I think the syntax you are looking for is datasubset <- data[ data$A ==1 & data$B == 1 , ] ) This gives the subset of your original data for variable A with value 1 and variable B with value 1. On Mon, May 25, 2020 at 12:57 PM Burgess, Jamie wrote: > > Dear all, > > I hope this message finds

[R] Help with sub-setting

2020-05-25 Thread Burgess, Jamie
Dear all, I hope this message finds you well. I am currently trying to subset my data by two variables, so far, I have tried two different ways to stratify participants into groups. I would like to use the �summary� and �table� arguments to characterise the data of participants based on the pre