I want to add facets by using qplot function in r. I imitated the parameter structure provided in R help, but it returned that the value cannot be found.
that the result i want to get by using qplot funcion
ggplot(otter, aes(time, body.temp, color = animal)) +
geom_line() +
facet_wrap(~ animal + day) +
ylab('Body temporature') +
theme_bw()
the facets parameter cannot work even i tried: facets = day ~ animal, facets = ~ day + animal
data is already attached
qplot(time, body.temp, geom = 'line',
color = animal, facets = ~ animal,
xlab = 'time', ylab = "Body temporature")