-
-
Save toyeiei/51f8bd329ea95855852d7f36f350dbe2 to your computer and use it in GitHub Desktop.
introduction to R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# R crash course | |
# create vectors | |
customer_name <- c("David", "Mary", "John", "Jack", "Daniel") | |
customer_age <- c(30, 32, 28, 20, 31) | |
customer_gender <- c("M", "F", "M", "M", "M") | |
customer_purchased <- c(TRUE, FALSE, FALSE, TRUE, TRUE) | |
# create a dataframe | |
customer_dataframe <- data.frame(customer_name, | |
customer_age, | |
customer_gender, | |
customer_purchased) | |
# first look at dataframe | |
print(customer_dataframe) | |
# useful functions to work with dataframe | |
str(customer_dataframe) | |
head(customer_dataframe) | |
tail(customer_dataframe) | |
summary(customer_dataframe) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment