Knowee
Questions
Features
Study Tools

## 1. Load data set(s) and libraries ```{r} load("C:\\Users\\local_9\\OneDrive\\Desktop\\Assignments\\Second Year\\Statistics\\Statistics final project\\High_School_Alcoholism") vars <- c("X1st_Semester_Grade", "Alcohol_Weekdays", "Alcohol_Weekends", "Desire_Graduate_Education") my_data <- data.frame(vars) library(descr) library(stats) save.image("myProject.RDATA") ```

Question

1. Load data set(s) and libraries

load(&quot;C:\\Users\\local_9\\OneDrive\\Desktop\\Assignments\\Second Year\\Statistics\\Statistics final project\\High_School_Alcoholism&quot;)

vars &lt;- c(&quot;X1st_Semester_Grade&quot;, &quot;Alcohol_Weekdays&quot;, &quot;Alcohol_Weekends&quot;, &quot;Desire_Graduate_Education&quot;)
my_data &lt;- data.frame(vars)
library(descr)
library(stats)

save.image(&quot;myProject.RDATA&quot;)

🧐 Not the exact question you are looking for?Go ask a question

Solution

This script is written in R, a programming language for statistical computing and graphics. Here's a step-by-step explanation of what the script does:

  1. The load function is used to load a dataset named "High_School_Alcoholism" from a specific location on the user's computer.

  2. The vars vector is created to store the names of four variables: "X1st_Semester_Grade", "Alcohol_Weekdays", "Alcohol_Weekends", and "Desire_Graduate_Education".

  3. A new data frame named my_data is created from the vars vector. However, this line of code seems to be incorrect because it tries to create a data frame from a vector of variable names, not the actual data.

  4. The library function is used to load two R packages: "descr" and "stats". The "descr" package is used for descriptive statistics, while the "stats" package is part of the base R distribution and contains functions for statistical calculations.

  5. The save.image function is used to save the current R workspace to a file named "myProject.RDATA". This allows the user to resume their work later by reloading the saved workspace.

This problem has been solved

Similar Questions

0/0

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.