library(randomNames)
library(readr)
n.rows <- 100000
data <- data.frame(id = 1:n.rows,
first.name = randomNames(1:n.rows, which.names="first"),
last.name = randomNames(1:n.rows, which.names="last"),
age = sample(15:90, n.rows, replace = T),
income = sample(500:3000, n.rows, replace = T)
)
write_csv(data, "./www/data_artificial_100000.csv") # 2.7 MB
# How many rows (m) and columns (n) does that dataset have?
n.rows <- 1000000
data <- data.frame(id = 1:n.rows,
first.name = randomNames(1:n.rows, which.names="first"),
last.name = randomNames(1:n.rows, which.names="last"),
age = sample(15:90, n.rows, replace = T),
income = sample(500:3000, n.rows, replace = T)
)
write_csv(data, "./www/data_artificial_1000000.csv") # 28 MB
# How many rows (m) and columns (n) does that dataset have?
n.rows <- 10000000
data <- data.frame(id = 1:n.rows,
first.name = randomNames(1:n.rows, which.names="first"),
last.name = randomNames(1:n.rows, which.names="last"),
age = sample(15:90, n.rows, replace = T),
income = sample(500:3000, n.rows, replace = T)
)
write_csv(data, "./www/data_artificial_10000000.csv") # 294 MB
# You wanna get stuck?
# n.rows <- 100000000
# data <- data.frame(id = 1:n.rows,
# first.name = randomNames(1:n.rows, which.names="first"),
# last.name = randomNames(1:n.rows, which.names="last"),
# age = sample(15:90, n.rows, replace = T),
# income = sample(500:3000, n.rows, replace = T)
# )
# write_csv(data, "./www/data_artificial_10000000.csv") # 2.97 GB