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))
plyr::ddply()
ord_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)gather(data,key,value,<include/exclude>)
reshape2::melt()
spread(data,key,value)
reshape2::cast()
Wickham, H et al. 2010. IEEE Transactions on Visualization and Computer Graphics 16 (6) (November): 973–979. doi:10.1109/TVCG.2010.161.