Justin Post
5272 SAS Hall | Justin_Post@ncsu.edu | 919.515.0637

Reading/Writing Data Activity

Write R code to do the following:

  1. Read in the BreastCancer.dat data file from the URL 'https://www4.stat.ncsu.edu/~online/datasets/BreastCancer.dat'. Save the R object as cancerData.
  2. Read in the mosquito.txt file from 'https://www4.stat.ncsu.edu/~online/datasets/mosquito.txt'. Save the R object as mosquitoData.
  3. Read in the mosquito2.txt file from 'https://www4.stat.ncsu.edu/~online/datasets/mosquito2.txt'. Note this is a tab delimited file. Save the R object as mosquitoData2.
    1. Use the code below to create a combined version of the mosquito data sets. Save the object as mosquitoFullData.
      rbind(mosquitoData, mosquitoData2)
    2. Write the mosquitoFullData out to a .csv file with name of your choice.
  4. Read in the effort.dta file form the URL 'https://www4.stat.ncsu.edu/~online/datasets/effort.dta'. Note that this is a stata file. Save the R object as effortData.