Re: [R] Finding values in a dataframe at a specified hour

2015-04-10 Thread Alexandra Catena
begins at 1, there is no element 0. Try using: > > for(i in 1:24) { > ... > > and see what happens. > > Jim > > > On Sat, Apr 11, 2015 at 7:06 AM, Alexandra Catena wrote: >> >> Update: >> >> I have this so far. * The first column of windHW is t

Re: [R] Finding values in a dataframe at a specified hour

2015-04-10 Thread Alexandra Catena
the day 0:23. Thanks, Alexandra On Fri, Apr 10, 2015 at 1:07 PM, Alexandra Catena wrote: > Hello, > > I have a large dataframe (windHW) of wind speeds (ws) at each hour > from many days over a set of years. Some of these values are > obviously wrong (600 m/s) and I want to get ri

[R] Finding values in a dataframe at a specified hour

2015-04-10 Thread Alexandra Catena
Hello, I have a large dataframe (windHW) of wind speeds (ws) at each hour from many days over a set of years. Some of these values are obviously wrong (600 m/s) and I want to get rid of all the values that are larger than 5*sigma for each hour. The 5*sigma (variable name sigma5) values are locat

[R] Plotting using tapply function output

2015-03-30 Thread Alexandra Catena
Hello, I am trying to plot the hourly standard deviation of wind speeds from 13 different measured locations over many years. I imported the data using readLines and into a dataframe called finalData. Using tapply, I determined the standard deviation of the windspeed (ws) for each hour (hour) from

[R] Error with using windRose function from the open air package

2015-02-23 Thread Alexandra Catena
Hello All, I have a data frame called windSFO of four columns, wind speed, wind direction, station number, and date (mmdd). I downloaded the gz data from a site online and then unzipped it using readLines. I then concatenated these four columns from the unzipped data into a dataframe using cb

[R] Replacing 9999 and 999 values with NA

2015-02-20 Thread Alexandra Catena
Hello All, I have a data frame of two columns for wind. The first column is for wind speed and the second wind direction. I'm trying to replace the values in the first column and the 999 values in the second column with NA. I tried to use the function ltdl.fix.df but it doesn't seem to do

[R] Help with looping

2015-02-17 Thread Alexandra Catena
Hi, I need help with a for loop and printing data. I want to loop through a few years and print the data from each year stacked on top of each other. For example, for (i in 2000:2003){ #script for downloading each year Data = readLines(sprintf('file/%4i,i)) } It only prints out the data from th

[R] How to unzip a .gz file

2015-02-10 Thread Alexandra Catena
Hello, Can someone help me with unzipping a .gz file. I used: readLines(gzfile('/home/file.gz')) I also found that I could use gunzip, but after trying to install it, it says: "package ‘gunzip’ is not available (for R version 2.15.1)" Thanks, Alexandra [[alternative HTML version d

Re: [R] How to download and unzip data in a loop

2015-02-05 Thread Alexandra Catena
Data Munger Guru >> >> What is the problem that you are trying to solve? >> Tell me what you want to do, not how you want to do it. >> >> On Wed, Feb 4, 2015 at 5:24 PM, Alexandra Catena >> wrote: >> >> Hi All, >>> >>> I need

[R] How to download and unzip data in a loop

2015-02-04 Thread Alexandra Catena
Hi All, I need to loop through and download the past 10 years of met data to a temporary directory. I then need to unzip it and place it into another directory. year = (2005:2015) for (i in year) tmpdir = tempdir() file[i] = file.path(tmpdir, sprintf('724927-23285-%4i.gz', i)) url = spri