data-frame

In R, what is the difference between the [] and [[]] notations for accessing the elements of a list?

R provides two different methods for accessing the elements of a list or data.frame- the [] and [[]] operators. What is the difference between the two? In what situations should I use one over the other? ...

How to do median splits within factor levels in R?

Here I make a new column to indicate whether myData is above or below its median ### MedianSplits based on Whole Data #create some test data myDataFrame=data.frame(myData=runif(15),myFactor=rep(c("A","B","C"),5)) #create column showing median split myBreaks= quantile(myDataFrame$myData,c(0,.5,1)) myDataFrame$MedianSplitWholeData = cut...