Subset and ggplot2

Here 2 options for subsetting: Using subset from base R: Using subset the argument of geom_line(Note I am using plyr package to use the special . function). You can also use the complementary subsetting:

Categories R

Meaning of objects being masked by the global environment

It means that you have objects (functions, usually) present in your global environment with the same name as (exported) things in your package. Type search() to see the order in which R resolves names. The solution is to either, don’t create objects with those names in your global environment rename the objects in your package … Read more

Categories R

Column standard deviation R [duplicate]

I was wondering if there was a built-in function in R that would compute the standard deviation for columns just like colMeans computes mean for every column. It would be simple enough to write my own mini function (a compound command that invokes things like apply with sd), but I was wondering if there was … Read more

Categories R

Warning: non-integer #successes in a binomial glm! (survey packages)

There’s nothing wrong, glm is just picky when it comes to specifying binomial (and Poisson) models. It warns if it detects that the no. of trials or successes is non-integral, but it goes ahead and fits the model anyway. If you want to suppress the warning (and you’re sure it’s not a problem), use family=quasibinomial … Read more

Categories R