How can I change the name of a data frame

The truth is that objects in R don’t have names per-se. There exists different kinds of environments, including a global one for every process. These environments have lists of names, that point to various objects. Two different names can point to the same object. This is best explained to my knowledge in the environments chapter … Read more

Filter rows which contain a certain string

The answer to the question was already posted by the @latemail in the comments above. You can use regular expressions for the second and subsequent arguments of filter like this: Since you have not provided the original data, I will add a toy example using the mtcars data set. Imagine you are only interested in cars produced by Mazda … Read more

Categories R

Create a matrix of scatterplots (pairs() equivalent) in ggplot2

You might want to try plotmatrix: to me mpg (first column in mtcars) should not be a factor. I haven’t checked it, but there’s no reason why it should be one. However I get a scatter plot 🙂 Note: For future reference, the plotmatrix() function has been replaced by the ggpairs() function from the GGally … Read more

Categories R