R in Jupyter

install conda environment via the src/install.bash script in this repo


In [1]:
library(dplyr)
library(ggplot2)


Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union


In [2]:
head(economics)


datepcepoppsavertuempmedunemploy
1967-07-01507.4 198712 12.5 4.5 2944
1967-08-01510.5 198911 12.5 4.7 2945
1967-09-01516.3 199113 11.7 4.6 2958
1967-10-01512.9 199311 12.5 4.9 3143
1967-11-01518.1 199498 12.5 4.7 3066
1967-12-01525.8 199657 12.1 4.8 3018

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 [ ]:
df <- data.frame(birth_state=c("Illinois", "Arizona", NA),
                 data_scientist=c("Kevin", "Matt", "Jonathan"))

In [ ]:
df

In [ ]:
df$birth_state == "Arizona"

In [ ]:
just_Arizona <- df[df$birth_state=="Arizona",]

In [ ]:
just_Arizona

In [ ]:
really_just_Arizona <- df[which(df$birth_state=="Arizona"),]

In [ ]:
really_just_Arizona

In [ ]: