similar to: How to calculate monthly average from daily files in R?

Displaying 20 results from an estimated 1100 matches similar to: "How to calculate monthly average from daily files in R?"

2010 Sep 07
1
adding variable to netCDF file
I would like to open an existing netCDF file and add a variable to it. I am using the ncdf package. This test code gives the idea of what I am trying to do: library(ncdf) print('here we go') print('first, construct netCDF file') t<-dim.def.ncdf('t','',1:1,unlim=T,create_dimvar=F) print('defining first vars')
2009 Mar 11
2
How to monthly,daily,yearly average
Sorry, this is my first time to post. I have a big data set: first colume is date (ex: 2008-2-150, the second is time (10:30:00), and the following columes are variaty measurement data. Every 30 min, I have one data. I want to find an effecient way to calculate the hourly, daily, monthly and yearly average, and plot them, and eventually use these average data to do further analysis. Thanks!
2008 Aug 06
2
Attempting to make a custom color spectrum to use in heatmap.2
Hello there! I'd just like to say in advance, "Thank you," for any help and/or advice. My problem is as follows: I have a dataset that is made up of percentages. I've assigned my "error" percentages a value of '-100', my "non-existent" percentages a value of '0', and all my other percentages are normal values that range from the high
2009 Sep 27
3
Teach me how to transpose in R
Hi guys, I need your help!! My goal is to make a csv file from ncdf file. This is the code i've used : > hyo=open.ncdf("C:/CRUTEM3.nc") > hyo [1] "file C:/CRUTEM3.nc has 4 dimensions:" [1] "longitude Size: 72" [1] "latitude Size: 36" [1] "unspecified Size: 1" [1] "t Size: 1916" [1] "------------------------"
2012 Apr 26
2
write to M, using row and columns taken from A and B, with values from C
I want to write to M, using row and columns taken from A and B, with values from C. C is a lot longer than A and B, so only the first 67420 elements of C are used in my loop.So how can I improve it to take then the next 67420 and write it to new file and so on till the 248th 67420. Many thanks library(Matrix) M <- Matrix(-9999, 360, 720) ## creat matrix with 720 columns and 360 ro ws
2009 Nov 17
1
How to plot an image in R
Dear all Im new in R I have a necdf data set that I want to plot : this is my data set [1] "file Tmax.DJF.daily.1981_1999.echama2.nc has 4 dimensions:" [1] "longitude Size: 127" [1] "latitude Size: 110" [1] "ht Size: 1" [1] "t Size: 1680" [1] "------------------------" [1] "file Tmax.DJF.daily.1981_1999.echama2.nc has 1
2013 Feb 18
1
How to calculate the moving average for binary files?
I have 12 binary (raster) files https://echange-fichiers.inra.fr/get?k=k3M2jatJyHy65Cs99G4 . I would like to calculate the moving average for the 12 values for each pixel in the 12 files. For a simple vector we can get a moving average by using this : x <- c(1,2,3,NA,NA,4,6,5,6,4,2,5) movingmean <- rollapply(x, 3, FUN = mean, na.rm = T,fill=NA) now
2010 Jun 21
2
Calculating a daily average
I have a set of data with 12 readings for temperature per day, with 180 days. I want to find the average temperature of each day. I am able to do this one by one, but with that many days to calculate the average for, it will get very long. I'm sure there is a faster way to do this, I just don't know how. What i have so far is: av1 <- subset(ER9r, Day == 98, select = c
2010 Jan 01
1
Chainging monthly data to daily data
Hi, I have a zoo object with monthly frequency : library(zoo) dat <- zooreg(rnorm(50), as.yearmon("2000-01-01"), frequency=12) Now I want to make a zoo object with daily frequency from "dat" wherein value for a each day for a particular month will be value of "dat" at that particular month. Is there any easy way to do that? Thanks, -- View this message in
2012 Apr 23
2
subset daily to monthly in a zoo or xts
Dear R users, I want to subset a daily zoo series according to its month, find % of "NA" in each month. I am finding it difficult to subset the daily dataset into monthly for the given operation.I am planning to do this for a huge dataset. Thanks in advance. Regards Vikram [[alternative HTML version deleted]]
2011 May 28
1
How to do operations on zoo/xts objects with Monthly and Daily periodicities
Is there an elegant way to do operations (+/-/*/ / ) on zoo/xts objects when one serie is monthly (end of month) and the other daily (weekdays only) - typically a monthly economic indicator and a stock index price? Thanks, TDB -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-operations-on-zoo-xts-objects-with-Monthly-and-Daily-periodicities-tp3558081p3558081.html
2012 Jan 05
1
[ncdf] programmatically copying a netCDF file
How to programmatically (i.e., without no or minimal handcoding) copy a netCDF file? (Without calling > system("cp whatever wherever") :-) Why I ask: I need to "do surgery" on a large netCDF file (technically an I/O API file which uses netCDF). My group believes a data-assimilation error caused a data variable to be corrupted in a certain way, so I'm going to
2009 Apr 15
2
From daily series to monthly and viceversa
I have the following daily exchange rate series (from january 1st 1996 to december 31st 2008) and I want to obtain them monthly series from it. I've read about the 'zoo' library but I'm not getting it how to do it. These are the data (left column day-month-year, right column the index) 31/12/1993 1,12509 03/01/1994 1,12509 04/01/1994 1,12558 05/01/1994 1,1258 06/01/1994 1,12596
2008 Mar 10
1
Error in extracting monthly observation from a daily time series data
Hi all, Suppose I have following dataset : library(zoo) SD = 1 date1 = seq(as.Date("01/01/90", format = "%m/%d/%y"), as.Date("12/31/08", format = "%m/%d/%y"), by = 1) len1 = length(date1); data1 = zoo(matrix(rnorm(len1, mean=0, sd=SD*0.5), nrow = len1), date1) Now I want to extract monthly observation. obs =
2009 Dec 22
1
Using zoo() to aggregate daily data to monthly means
I am trying to get monthly means for a daily data series using zoo(). I have found an odd problem, that seems to be caused by zoo()'s handling of leap years. Here's my R script with 2 methods (freq=365, 366) for aggregating the daily data to monthly series: library(zoo) J_link <- "http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv" JAXA_data <- read.table(J_link,
2010 Dec 03
0
Calculating weekly/bi-monthly average for time series data
Dear all, given a daily time series data, I am able to calculate monthly average, quarterly average like:   library(zoo) dat <- zooreg(rnorm(500), start=as.Date("2000-01-01"), frequency=1) mo.ave <- aggregate(dat, as.yearmon(index(dat)), "mean") head(dat) head(mo.ave) However is there any direct way like above to calculate the weekly average, bi-monthly average?   Thanks
2010 Apr 21
4
Converting daily data series to monthly series
Hi Users, I have daily series of data from 1962 - 2000, with the data for February 29th in leap years excluded, leaving 365 daily values for each year. I wish to convert the daily series to monthly series. How can I do this using the zoo package or any other package? Thanks ZABLONE OWITI GRADUATE STUDENT Nanjing University of Information, Science and Technology College of International
2011 Sep 07
1
Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B
Dear Colleagues: Through your help an R related installation issue was resolved, but I now have the following usage issue. On any "get.var.ncdf" usage I am seeing: Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B The same error is posted on a file as small as 50MB and as large as 500GB, with ulimit set to unlimited. I
2008 Jan 22
1
install ncdf package on a 64-bit machine
Dear All, I recently got a 64bit machine and had netcdf-3.6.2 installed. Then I tried to install ncdf package but got the following error message when using netcdflib: gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include -I/home/ljin/share/R-2.6.1/include -I. -I/usr/local/include -fpic -g -O2 -c ncdf2.c -o ncdf2.o gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include
2019 Jul 10
2
Standalone server and POSIX ACL issue
Le 10/07/2019 ? 08:46, Rowland penny via samba a ?crit?: > On 09/07/2019 22:49, Yvan Masson wrote: >> Le 09/07/2019 ? 21:16, Rowland penny via samba a ?crit?: >>> On 09/07/2019 20:06, Yvan Masson via samba wrote: >>>> Hi, >>>> >>>> First, thanks for all people that continuously giving great advice >>>> on this list!