This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qplot(depth, data=diamonds, geom="density", xlim = c(54, 70), | |
fill = cut, alpha = I(0.2)) + | |
labs(fill = "My Style \nDensity Plot" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Doesn't work | |
# grp -- name of a column of the the data.frame df | |
# function call is -- getMinMax1( df1 , grp = "g10") | |
getMinMax1 <-function(df, grp){ | |
dfret <- ddply( df , .(as.name(grp)), ## I am using as.name(grp), source of error | |
function(x){ | |
minmax <- c(mix(x[ , 3]), max(x[ ,3])) | |
return(minmax) |