

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Stat 133, Fall ’ Homework 2: Data Structures in R Due Friday, 15 Sep
Manipulating Data in R
Our analysis of data is often made easier by having it in a suitable structure. This lab gives you practice with reshaping, reformatting, and labeling data. The func- tions as.factor, as.numeric etc. and [ ] and [[ ]] may prove very useful in this lab as well as functions from the apply family, tapply, lapply, apply, sapply.
http://www.stat.berkeley.edu/users/nolan/ stat133/data/Chip.rda
Make the following adjustments to the chip data frame and call the resulting data frame intel:
Be sure to write your code in a general way. For example, do not depend on the fact that there are 10 rows in the data frame, and you know that the last two rows have values of “GHz” in the speed variable. Instead, search in the speed variable for those elements with particular values, and use that information to adjust Clock.
http://www.stat.berkeley.edu/users/nolan/ stat133/data/FrontRange.rda
http://www.stat.berkeley.edu/users/nolan/ stat133/data/FrontRange2.rda
In addition to the day and amount of daily rainfall recorded, for each weather station we also have the station’s latitude, longitude, elevation, the number of days the station was in operation, and the mean total summer precipita- tion at the station.
Upload this file as a plain text (include your code and answers in the same text document – you may want to use the comment symbol # before your answers) by 6 p.m. on the due date.