This file contains a set of tasks that you need to complete in R for the lab assignment. The tasks may require you to add a code chuck, type code into a chunk, and/or execute code. Some tasks may also ask you to answer specific questions. Don’t forget that you need to acknowledge if you used any resources to complete the assignment.
Instructions associated with this assignment can be found in the file “Instructions Getting Started in R.rmd”.
Once you have completed the assignment you will need to publish it to produce an html file. You will then need to upload the html file and this .Rmd file to AsULearn.
The first thing you need to do in this file is to add your name and date in the lines underneath this document’s title (see the code in lines 10 and 11).
You need to identify and set your working directory in this section.
getwd()
## [1] "C:/Users/tjgra/Downloads/LAB"
setwd("C:/Users/tjgra/Downloads/LAB")
You need to install and load the packages and data set you’ll use for the lab assignment in this section.
install.packages("openxlsx")
## Installing package into 'C:/Users/tjgra/AppData/Local/R/win-library/4.4'
## (as 'lib' is unspecified)
## package 'openxlsx' successfully unpacked and MD5 sums checked
## Warning: cannot remove prior installation of package 'openxlsx'
## Warning in file.copy(savedcopy, lib, recursive = TRUE): problem copying
## C:\Users\tjgra\AppData\Local\R\win-library\4.4\00LOCK\openxlsx\libs\x64\openxlsx.dll
## to
## C:\Users\tjgra\AppData\Local\R\win-library\4.4\openxlsx\libs\x64\openxlsx.dll:
## Permission denied
## Warning: restored 'openxlsx'
##
## The downloaded binary packages are in
## C:\Users\tjgra\AppData\Local\Temp\Rtmpkr1czb\downloaded_packages
library(openxlsx)
Choose one variable in the data set and displace the observations on the screen. You can choose any variable other than “stateabb” used in the instructions.
GettingStartedData <- read.xlsx("states2016.xlsx")
print(GettingStartedData$stateabb)
## [1] "USA" "CAN" "BHM" "CUB" "CUB" "HAI" "HAI" "DOM" "DOM" "JAM" "TRI" "BAR"
## [13] "DMA" "GRN" "SLU" "SVG" "AAB" "SKN" "MEX" "BLZ" "GUA" "HON" "SAL" "NIC"
## [25] "COS" "PAN" "COL" "VEN" "GUY" "SUR" "ECU" "PER" "BRA" "BOL" "PAR" "PAR"
## [37] "CHL" "ARG" "URU" "UKG" "IRE" "NTH" "NTH" "BEL" "BEL" "LUX" "LUX" "FRN"
## [49] "FRN" "MNC" "LIE" "SWZ" "SPN" "AND" "POR" "HAN" "BAV" "GMY" "GMY" "GFR"
## [61] "GDR" "BAD" "SAX" "WRT" "HSE" "HSG" "MEC" "POL" "POL" "AUH" "AUS" "AUS"
## [73] "HUN" "CZE" "CZE" "CZR" "SLO" "ITA" "PAP" "SIC" "SNM" "MOD" "PMA" "TUS"
## [85] "MLT" "ALB" "ALB" "MNG" "MAC" "CRO" "YUG" "YUG" "BOS" "KOS" "SLV" "GRC"
## [97] "GRC" "CYP" "BUL" "MLD" "ROM" "RUS" "EST" "EST" "LAT" "LAT" "LIT" "LIT"
## [109] "UKR" "BLR" "ARM" "GRG" "AZE" "FIN" "SWD" "NOR" "NOR" "DEN" "DEN" "ICE"
## [121] "CAP" "STP" "GNB" "EQG" "GAM" "MLI" "SEN" "BEN" "MAA" "NIR" "CDI" "GUI"
## [133] "BFO" "LBR" "SIE" "GHA" "TOG" "CAO" "NIG" "GAB" "CEN" "CHA" "CON" "DRC"
## [145] "UGA" "KEN" "TAZ" "ZAN" "BUI" "RWA" "SOM" "DJI" "ETH" "ETH" "ERI" "ANG"
## [157] "MZM" "ZAM" "ZIM" "MAW" "SAF" "NAM" "LES" "BOT" "SWA" "MAG" "COM" "MAS"
## [169] "SEY" "MOR" "MOR" "ALG" "TUN" "TUN" "LIB" "SUD" "SSD" "IRN" "TUR" "IRQ"
## [181] "EGY" "EGY" "SYR" "SYR" "LEB" "JOR" "ISR" "SAU" "YAR" "YEM" "YPR" "KUW"
## [193] "BAH" "QAT" "UAE" "OMA" "AFG" "TKM" "TAJ" "KYR" "UZB" "KZK" "CHN" "MON"
## [205] "TAW" "KOR" "PRK" "ROK" "JPN" "JPN" "IND" "BHU" "PAK" "BNG" "MYA" "SRI"
## [217] "MAD" "NEP" "THI" "CAM" "LAO" "DRV" "RVN" "MAL" "SIN" "BRU" "PHI" "INS"
## [229] "ETM" "AUL" "PNG" "NEW" "VAN" "SOL" "KIR" "TUV" "FIJ" "TON" "NAU" "MSI"
## [241] "PAL" "FSM" "WSM"
Enter the names of anyone one that assisted you with completing this lab. If no one helped you complete just type type out no one helped you. no #Did you provide anyone help with completing this lab? Enter the names of anyone that you assisted with completing this lab. If you did not help anyone, then just type out that you helped no one. no # Publish Document Click the “Knit” button to publish your work as an html document. This document or file will appear in the folder specified by your working directory. You will need to upload both this RMarkdown file and the html file it produces to AsU Learn to get all of the lab points for this week.