###################################################################
#### Module 3, Lesson about Vectors, Basic Functions, and Help ####
###################################################################
# Lesson 6, part 2: Intro to dataframes (changing values and columns)

# First upload the built in ChickWeight dataset again:
data(ChickWeight)


###################################
##### MODIFYING DATAFRAMES
# Here we go over how to modify your dataframe by changing column
# names and adding columns.

names(ChickWeight) <- c("weight_g", "time_days", "chick_id", "diet")

head(ChickWeight)

nrow(ChickWeight)

chick_heights <- sample(6:40, 578, replace=T)

ChickWeight$height_cm <- chick_heights

head(ChickWeight)

ChickWeight$sex <- "male"

chick_heights <- 1:17
ChickWeight$height_cm <- chick_heights

head(ChickWeight)

ChickWeight$data_collector <- "Jon Snow"

weight_converted <- ChickWeight$weight_g / 1000
length(weight_converted)

ChickWeight$weight_kg <- ChickWeight$weight_g / 1000




###################################
##### SUMMARY
# - creating and modifying columns
