Data_IO_Lab Key
Data_IO_Lab Key
Copyright By PowCoder代写 加微信 powcoder
In this lab you can use the interactive console to explore or Knit the document. Remember anything you type here can be “sent” to the console with Cmd-Enter (OS-X) or Ctrl-Enter (Windows/Linux) in an R code chunk.
Read in the Youth Tobacco study from data/Youth_Tobacco_Survey_YTS_Data.csv and name it youth
library(readr)
youth = read_csv(“data/Youth_Tobacco_Survey_YTS_Data.csv”)
## Rows: 9794 Columns: 31
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: “,”
## chr (24): LocationAbbr, LocationDesc, TopicType, TopicDesc, MeasureDesc, Dat…
## dbl (7): YEAR, Data_Value, Data_Value_Std_Err, Low_Confidence_Limit, High_C…
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Check youth for any problems.
problems(youth)
## # A tibble: 0 × 5
## # … with 5 variables: row
## # file
stop_for_problems(youth)
Load the readxl package with the library command. If it is not installed, install it via: RStudio –> Tools –> Install Packages
library(readxl)
Use the read_excel() function in the readxl package to read the Monuments.xlsx file and call the output mon.
mon = read_excel(“data/Monuments.xlsx”)
Write out the mon object as a CSV file calling it “monuments.csv”, using readr::write_csv:
write_csv(mon, “monuments.csv”)
Write out the mon object as a RDS file calling it “monuments.rds”, using readr::write_rds:
readr::write_rds(mon, “monuments.rds”)
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com