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] "/Users/chloelemos/Downloads/Assignment Getting Started in R"
You need to install and load the packages and data set you’ll use for the lab assignment in this section.
install.packages("openxlsx")
##
## The downloaded binary packages are in
## /var/folders/t7/t0d_jym12pq4ywtrl8ts15700000gp/T//RtmpXRX914/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$styear)
## [1] 1816 1920 1973 1902 1909 1859 1934 1894 1924 1962 1962 1966 1978 1974 1979
## [16] 1979 1981 1983 1831 1981 1868 1899 1875 1900 1920 1903 1831 1841 1966 1975
## [31] 1854 1839 1822 1848 1846 1876 1839 1841 1882 1816 1922 1816 1945 1830 1945
## [46] 1920 1944 1816 1944 1993 1990 1816 1816 1993 1816 1837 1816 1816 1990 1955
## [61] 1954 1816 1816 1816 1816 1816 1843 1918 1945 1816 1919 1955 1918 1918 1945
## [76] 1993 1993 1816 1816 1816 1992 1842 1851 1816 1964 1914 1944 2006 1993 1992
## [91] 1878 1944 1992 2008 1992 1828 1944 1960 1908 1991 1878 1816 1918 1991 1918
## [106] 1991 1918 1991 1991 1991 1991 1991 1991 1917 1816 1905 1945 1816 1945 1944
## [121] 1975 1975 1974 1968 1965 1960 1960 1960 1960 1960 1960 1958 1960 1920 1961
## [136] 1957 1960 1960 1960 1960 1960 1960 1960 1960 1962 1963 1961 1963 1962 1962
## [151] 1960 1977 1898 1941 1993 1975 1975 1964 1965 1964 1920 1990 1966 1966 1968
## [166] 1960 1975 1968 1976 1847 1956 1962 1825 1956 1951 1956 2011 1855 1816 1932
## [181] 1855 1937 1946 1961 1946 1946 1948 1927 1926 1990 1967 1961 1971 1971 1971
## [196] 1971 1919 1991 1991 1991 1991 1991 1860 1921 1949 1887 1948 1949 1860 1952
## [211] 1947 1971 1947 1971 1948 1948 1965 1920 1887 1953 1953 1954 1954 1957 1965
## [226] 1984 1946 1949 2002 1920 1975 1920 1981 1978 1999 2000 1970 1999 1999 1991
## [241] 1994 1991 1976
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 one helped me.
#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.
I 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.