这个是data
http://www.stat.berkeley.edu/users/cgk/teaching/assets/flow-occ-table.txt
These data have been collected by loop detectors at one particular location of eastbound
Interstate 80 in Sacramento. There are six columns and 1740 rows in the data set. The
rows correspond to successive 5 minute intervals from March 14 to 20, 2003, where the
data values in a row report the
ow (number of cars) and occupancy (the proportion of
time there was a car over the loop) in each of three lanes on the freeway. Lane 1 is the
leftmost lane, lane 2 is in the center, and lane 3 is the rightmost. The rst row of data
corresponds to the rst 5 minutes after midnight, March 14, and the last row corresponds
to the ve minute interval beginning at 00:55, March 20. The original data are from the
Freeway Performance Measurement System (PEMS) website: http://pems.dot.ca.gov.
问题是
1. Read the data directly from the web into R. Remove the columns that have the
occupancy information; just keep the
flows.
2. Using the summary function, explore the univariate distributions for the
ow in each
of the three lanes. Which lanes appear to have lower or higher
ow overall? (Add
the answer as a comment to your le.)
3. Create a vector called timeofday that gives the fraction of a day at which each row
of the table begins. This should be in terms of hours on the 24-hour clock (each row
is a ve-minute interval), with the rst few elements as follows:
> timeofday[1:13]
[1] 0.00000000 0.08333333 0.16666667 0.25000000 0.33333333 0.41666667
[7] 0.50000000 0.58333333 0.66666667 0.75000000 0.83333333 0.91666667
[13] 1.00000000
and the last few elements
> timeofday[1728:1740]
[1] 23.91666667 0.00000000 0.08333333 0.16666667 0.25000000
[6] 0.33333333 0.41666667 0.50000000 0.58333333 0.66666667
[11] 0.75000000 0.83333333 0.91666667
Hint: You will need one of the special mathematical operators we talked about on the
second day of class.
4. Make a scatterplot showing the relationship between
ow and time of day, with time
of day on the x-axis and total
ow (summing across the three lanes) on the y-axis.
Describe any patterns you see in a comment. (You don't need to turn in the plot
itself.)
关键是我只是会
flow <- read.table( file = "http://www.stat.berkeley.edu/users/cgk/teaching/assets/flow-occ-table.txt", header = TRUE)
这个,之后怎么可以去occupancy 的columns...请只教,万分感激