vendredi 22 septembre 2023

this assignment question, im a beginner in R so basic commands to solve it plz [closed]

Create a data frame named “student_data” with three columns: “Name,” “Age (in years ranging randomly 18 to 25),” and “Grade.” Populate the data frame with information for at least 10 students (using Rstudio)

i'm not sure whether we assign 'Name' to random names, the same goes for grades and dont get what was meant by " at least 10 student" however this is what i did (using Rstudio)

Name <- paste("Student", 1:10)

Age <- sample(18:25,10,replace = T)

Grade <- sample(1:100,10,replace = T)

student_data <- data.frame(Name,Age,Grade)

we didn't study the paste() and sample() command yet so idk how to solve this problem in another way




Aucun commentaire:

Enregistrer un commentaire