R Tips 20081126 - An exercise
Question:
The following ten observations, taken during the years 1970-79, are on October snow cover for Eurasia.
(Snow cover is in millions of square kilometers):
year snow.cover
1970 6.5
1971 12.0
1972 14.9
1973 10.0
1974 10.7
1975 7.9
1976 21.9
1977 12.5
1978 14.5
1979 9.2
i. Enter the data into R.
ii. Plot snow.cover versus year.
II. Plot logarithms of snow.cover versus year
Answer:
>year <- 1970:1979
>snow.cover <- c(6.5, 12.0, 14.9, 10.0, 10.7. 7.9, 21.9, 12.5, 14.5, 9.2)
>snow.cover.log <- log(snow.cover)
>Eurasia.Snow <- data.frame(year, snow.cover, snow.cover.log)
>plot(snow.cover ~ year, data=Eurasia.Snow, pch=16)
>plot(snow.cover.log ~ year, data=Eurasia.Snow, pch=16)

恩,以上就是我编写的第一个R统计软件程序。
Popularity: 12% [?]
