In [1]:
library(dplyr)
library(ggplot2)
In [2]:
head(economics)
Out[2]:
In [3]:
a <- ggplot(data = economics, aes(x = date, y = unemploy))
a <- a + geom_line()
a
In [4]:
a <- ggplot(data = economics, aes(x = date, y = unemploy))
a <- a + geom_line()
a <- a + geom_smooth(method = "loess")
a
In [5]:
df <- data.frame(birth_state=c("Illinois", "Arizona", NA),
data_scientist=c("Kevin", "Matt", "Jonathan"))
In [6]:
df
Out[6]:
In [7]:
df$birth_state == "Arizona"
Out[7]:
In [8]:
just_Arizona <- df[df$birth_state=="Arizona",]
In [9]:
just_Arizona
Out[9]:
In [10]:
really_just_Arizona <- df[which(df$birth_state=="Arizona"),]
In [11]:
really_just_Arizona
Out[11]:
In [ ]: