Overview

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. You need to make sure that you place the chunk(s) of code in the appropriate sections of the document. For example, you need to put the two chunks of code required to complete Task #2 in that section. Do not put those chunks under Task #1 or Task #3. 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 knit it to produce an html file. You will then need to upload the html file and this .Rmd file to AsULearn.

1. Add your Name and the Date

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).

2.Identify and Set Your Working Directory

You need to identify and set your working directory in this section.

3. Installing and Loading Packages and Data Set

You need to install and load the packages and data set you’ll use for the lab assignment in this section.

Did you recieve help?

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.

#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.

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.

getwd()
## [1] "C:/Users/faye.CARLA/Desktop/Research Methods Lab/Assignment Getting Started in R Fall 2025"
setwd("C:/Users/faye.CARLA/Desktop/Research Methods Lab/Assignment Getting Started in R Fall 2025")
install.packages("openxlsx")
## Installing package into 'C:/Users/faye.CARLA/AppData/Local/R/win-library/4.5'
## (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\faye.CARLA\AppData\Local\R\win-library\4.5\00LOCK\openxlsx\libs\x64\openxlsx.dll
## to
## C:\Users\faye.CARLA\AppData\Local\R\win-library\4.5\openxlsx\libs\x64\openxlsx.dll:
## Permission denied
## Warning: restored 'openxlsx'
## 
## The downloaded binary packages are in
##  C:\Users\faye.CARLA\AppData\Local\Temp\RtmpYzdGev\downloaded_packages
library("openxlsx")
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"