Skip to content

Instantly share code, notes, and snippets.

@toyeiei
Last active August 15, 2019 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toyeiei/131a53fec9607b8cb06a880012cca9bd to your computer and use it in GitHub Desktop.
Save toyeiei/131a53fec9607b8cb06a880012cca9bd to your computer and use it in GitHub Desktop.
R4Excel - data transformation
## select columns
df %>%
select(id, student_name, gender)
## filter rows
df %>%
select(id, student_name, gender) %>%
filter(gender == "M")
## sample rows n=30
df %>%
sample_n(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment