mirror of
https://github.com/WMK965/965-R-Learning-Repo.git
synced 2025-04-27 20:33:20 +00:00
12 lines
354 B
R
12 lines
354 B
R
age <- c(6, 14, 12, 10)
|
|
name <- c("Audree", "Andy", "Rose", "Andrew")
|
|
gender <- c("female", "male", "female", "male")
|
|
info <- data.frame(age, name, gender)
|
|
print(info[3, 2])
|
|
print(info[2:3, ])
|
|
info <- info[-c(1), ]
|
|
print(info[7 < info[, 1] & info[, 1] < 13])
|
|
info[2, 1] <- 8
|
|
print(summary(info))
|
|
info$gender <- as.factor(info$gender)
|
|
print(summary(info)) |