Ross Ihaka and Robert Gentleman Year

Ross Ihaka and Robert Gentleman Year

MULTI-FILES LOADER file_01.csv GGPLOT2 data(aes) + geom + labels R (Statistical computing) files <- list.files(pattern = “file_.*csv”) %>% ggplot(data = df, aes(x_col, y_col)) + geom() CHEET SHEET BY @CHARLSTOWN lapply(files, read_csv) %>% canvas + layer +...+ labs > general structure CREATOR: ROSS IHAKA AND ROBERT GENTLEMAN bind_rows() YEAR: 1995 ggplot(data = df) > canvas level STEABLE RELEASE (2020): 3.6.2 DATA FRAMES ACTIONS dplyr & tidyr aes(x_col, y_col) > aesthetics TOP FROM R: DPLYR, GGPLOT2, ESQUISSE, BIO DPLYR FUNCTIONS df %>% function geom_point() > geometry level CONDUCTOR, SHINY, LUBRIDATE, KNITR, TIDYR. rename(c_new = c1) > rename columns AESTHETICS aes(*) select(col) > select column ELEMENTAL LIBRARIES library( * ) select(-col) > drop column x_col, y_col > sets x,y elements library(dplyr) > Easy commands filter(c == “value”) > select rows label=labels > set ticks labels library(ggplot2) > Generate plots mutate(col = (c1+2)) > column mutations color > sets color values library(tidyverse) > Tidy data transmute(c1=c, c2=c/2) > drop & built cols alpha > sets the opacity library(kableExtra) > Table visualization arrange(des(c1)) > order by column fill = ‘color’ > sets the filled color library(knitr) > Regular exprs. join(df2) > join 2 data frames shape = class > set groups by class library(readr) > Files Reader group_by(col) > silent grooping group = class > sets plot by class library(stringr) > Strings treatment summarise(c* = max(c)) > after grooping shape > geometry shape size = 4 > sets the size TIDYR FUNCTIONS df %>% function install.packages(“name”) > Install library stroke > set boundary line ?library > Documentation gather(‘key‘, ‘value’, 2:4) > wide to long df GEOMETRIES ggplot() + geom BASIC FUNCTIONS df and columns spread( ‘key’, ‘value’) > long to wide df geom_point() > simple points geom_bar() > bars chart read_csv(“file.csv”) > data reader unite(col, ‘-’, c1, c2) > join 2 columns geom_smooth() > Inserts a function head(df) > show first rows jitter_geom() > points no overlap names(df) > object names separate(col, > split col by symbol c(c1, c2), ‘symbol’) geom_density() > continuous funct. colnames(df) > columns names geom_text() > plot text inside rownames(df) > rows names full_seq(c(1, 3, 4), step) > complete sequence geom_segment() > Plots a segment nrow(df) > number of rows stat_function() > inserts function ncol(df) > number of cols. separate_rows(c, > split values in row geom_boxplot() > box plot length(df) > object length sep = ‘&’) dim(df) > matrix dimension LABELS ggplot() + labs(*) summary(df) > summary by var. fill(column) > fill NAs in column title > main title str(df) > features structure replace_na(‘var‘) > replace NA for var df$col > extracts column subtitle > subtitle df[1:3 , 2:5] > subdf by index drop_na() > drop rows with NA x > x label df[, c(1:3, 5)] > columns by index y > y label typeof(col) > column type color > color caption > reference.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us