-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataGenerato.R
More file actions
25 lines (18 loc) · 971 Bytes
/
Copy pathdataGenerato.R
File metadata and controls
25 lines (18 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#code for organism, samples five names 100 times and has the ability to replace
#set a seed for reproducibility
set.seed(7127)
Organism <- sample(c("Homo sapiens","Homo erectus","Homo neanderthalensis","Denisova hominins","Homo luzonensis"),100,replace = T)
Organism
#code for limb width, random normal distribution with mean of 10 and sd of 2
Limb_Width <- abs(rnorm(100, mean = 10, sd = 2))
Limb_Width
#code for limb height, random normal distribution with mean of 79 and sd of 15
Limb_Height <- abs(rnorm(100, mean = 79, sd = 15))
Limb_Height
#code for observer, samples three names 100 times and has the ability to replace
Observer <- sample(c("Caleb P","Kennedy R","Louie Y"),100,replace = T)
Observer
#combines all vectors into one data frame
measurements <- data.frame(Organism, Limb_Width, Limb_Height, Observer)
#writes the data frame to a CSV file
write.csv(measurements, "C:\\Users\\Caleb\\Desktop\\Winter 2023 Stats\\measurements.csv",row.names = F)