## Loads up and arranges the environmental ## data in the S-File: ch3hst1.r ## ## Data from UCAR Stats Project: ## http://www.cgd.ucar.edu/stats/web.book/BOOK ## ## ## Load the Data: source(file=url("http://www.math.csi.cuny.edu/~poje/R_stuff/ch3hst1.r")) ## Now do something Dumb -> Must be a simpleR way. tozone = ch3hst1[1:2354,1] ttmax = ch3hst1[1:2354,5] twsp = ch3hst1[1:2354,6] tu = ch3hst1[1:2354,7] tv = ch3hst1[1:2354,8] ttam = ch3hst1[1:2354,15] ttpm = ch3hst1[1:2354,14] ## Now make sure to get rid of pesky NA values: z = is.na(tozone) Ozone = tozone[!z] z = is.na(twsp) Wspeed = twsp[!z] z = is.na(ttmax) Tmax = ttmax[!z] z = is.na(tu) SpeedX = tu[!z] z = is.na(tv) SpeedY = tv[!z] z = is.na(ttam) Tday = ttam[!z] z = is.na(ttpm) Tnight = ttpm[!z] ## Store a data.frame if I knew how! ## Must Be Same Length! ll = c(1:2302) OzoneData = data.frame("Ozone"=Ozone[ll],"SpeedX"=SpeedX[ll], "SpeedY"=SpeedY[ll], "TempMax"=Tmax[ll],"T_daytime"=Tday[ll], "T_nightime"=Tnight[ll],"WindSpeed"=Wspeed[ll]) # Attach the Data Frame ... get at names attach(OzoneData) ## Clean up the mess. rm(list = c("twsp","tu","tv","tozone","ttmax","ttam","ttpm","ch3hst1","z", "SpeedX","SpeedY","Tday","Tmax","Tnight","Ozone","Wspeed","ll")) ## Thats all folks