[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

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

2015-04-10 Thread Alexandra Catena
. Thanks, Alexandra On Fri, Apr 10, 2015 at 1:07 PM, Alexandra Catena amc5...@gmail.com 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 rid of all

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 amc5...@gmail.com wrote: Update: I have this so far. * The first column of windHW is the wind speed. The 5th column of the dataframe, spring

[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)

[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

[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

[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

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

2015-02-05 Thread Alexandra Catena
you want to do, not how you want to do it. On Wed, Feb 4, 2015 at 5:24 PM, Alexandra Catena amc5...@gmail.com wrote: 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

[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 =