September 2021
General introduction to data viz principles and tools
git add foo.rmd
)git clone
File
> New Project
> Version Control
> Git
> fill in name from “Clone” button on GHgit pull
)
git add
)
git commit
)
git push
)
filter(x,condition)
: choose rows equivalent to subset(x,condition)
or x[condition,]
(with non-standard evaluation)select(x,condition)
: choose columns
subset(x,select=condition)
or x[,condition]
starts_with()
, matches()
mutate(x,var=...)
: change or add variables (equivalent to x$var = ...
or transform(x,var=...)
group_by()
: adds grouping informationsummarise()
: collapses variables to a single valuex <- group_by(x,course) summarise(x,mean_score=mean(score),sd_score=sd(score))
d_split <- split(d,d$var) ## split d_proc <- lapply(d_split, ...) ## apply d_res <- do.call(rbind,d_proc) ## combine
%>%
operator (orig. from magrittr
package)(d_input %>% select(row1,row2) %>% filter(cond1,cond2) %>% mutate(...) ) -> d_output
tib[,"column1"]
is still a tibble)tidyr
package)dotwhisker
package)Cleveland, W. 1993. Visualizing Data. Summit, NJ: Hobart Press.
Gelman, A et al. 2002.. The American Statistician 56 (2): 121–130. http://www.tandfonline.com/doi/abs/10.1198/000313002317572790.
Wickham, H et al. 2010.. IEEE Transactions on Visualization and Computer Graphics 16 (6) (November): 973–979. doi:10.1109/TVCG.2010.161.