I am trying to use ggplot with subsets to make individually-styled lines for different values of MyName.
This works if I set up the data frame as a temporary variable temp that gets referred to in the subset function like
temp <- data.frame(x = ..., y = ..., MyName = ...)
temp %>% ggplot(aes(x = x, y= y) + geom_line(data = subset(temp, MyName == "Var Name"), ...)
except that I prefer to avoid creating a temporary data frame.
Is there a syntax that allows me to avoid this? Something like the . in this, except correct:
data.frame(x = ..., y = ..., MyName = ...) %>%
%>% ggplot(aes(x = x, y= y) + geom_line(data = subset(., MyName == "Var Name"), ...)
This says object '.' not found.