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.
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/rebra/Downloads/Assignment Getting Started in R Fall 2025 (7)/Assignment Getting Started in R Fall 2025"
setwd(/Users/rebra/Downloads/Assignment Getting Started in R Fall 2025 (7)/Assignment Getting Started in R Fall 2025”)
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/rebra/AppData/Local/R/win-library/4.5'
## (as 'lib' is unspecified)
## package 'openxlsx' successfully unpacked and MD5 sums checked
##
## The downloaded binary packages are in
## C:\Users\rebra\AppData\Local\Temp\Rtmpma42kT\downloaded_packages
library("openxlsx")
GettingStartedData<-read.xlsx("states2016.xlsx")
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.
print(GettingStartedData$ccode)
## [1] 2 20 31 40 40 41 41 42 42 51 52 53 54 55 56 57 58 60
## [19] 70 80 90 91 92 93 94 95 100 101 110 115 130 135 140 145 150 150
## [37] 155 160 165 200 205 210 210 211 211 212 212 220 220 221 223 225 230 232
## [55] 235 240 245 255 255 260 265 267 269 271 273 275 280 290 290 300 305 305
## [73] 310 315 315 316 317 325 327 329 331 332 335 337 338 339 339 341 343 344
## [91] 345 345 346 347 349 350 350 352 355 359 360 365 366 366 367 367 368 368
## [109] 369 370 371 372 373 375 380 385 385 390 390 395 402 403 404 411 420 432
## [127] 433 434 435 436 437 438 439 450 451 452 461 471 475 481 482 483 484 490
## [145] 500 501 510 511 516 517 520 522 530 530 531 540 541 551 552 553 560 565
## [163] 570 571 572 580 581 590 591 600 600 615 616 616 620 625 626 630 640 645
## [181] 651 651 652 652 660 663 666 670 678 679 680 690 692 694 696 698 700 701
## [199] 702 703 704 705 710 712 713 730 731 732 740 740 750 760 770 771 775 780
## [217] 781 790 800 811 812 816 817 820 830 835 840 850 860 900 910 920 935 940
## [235] 946 947 950 955 970 983 986 987 990
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.
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.