Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create a data frame
- names <- c("JP","MK")
- gender <- c('M','F')
- df <- data.frame(names,gender)
- # Convert DF to string as factors = FALSE
- df <- data.frame(names,gender,stringsAsFactors = FALSE)
- # Add records to data frame using ROW BIND
- df <- rbind(df,c("Sharon","F"))
- head(df)
- # Add records to data frame using COLUMN BIND
- favfood <-c("Pizza","IceCream","Chocolate")
- df <- cbind(df,favfood)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement