# Query about calculating the monthly average of daily data columns

17 messages
Open this post in threaded view
|

## Query about calculating the monthly average of daily data columns

 Dear R-users, I have daily data from 03-01-1994 to 29-12-2000. In my datafile, he first column is date and the second and third columns are the returns of the country A, and B. Here, the date column is same for both countries. I want to calculate the monthly average of both country's returns by using a loop, and then, I want to export the results into excel. Please help me in this regard. Please find the attached datasheet. Thank you. -- *Best Regards,* *Subhamitra Patra* *Phd. Research Scholar* *Department of Humanities and Social Sciences* *Indian Institute of Technology, Kharagpur* *INDIA* [image: Mailtrack] Sender notified by Mailtrack 09/12/19, 08:23:07 PM ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

 In reply to this post by Subhamitra Patra Hello, Please include data, say dput(head(data, 20))  # post the output of this But, is the problem as simple as rowMeans(data[2:3], na.rm = TRUE) ? Hope this helps, Rui Barradas Às 15:53 de 12/09/19, Subhamitra Patra escreveu: > Dear R-users, > > I have daily data from 03-01-1994 to 29-12-2000. In my datafile, he first > column is date and the second and third columns are the returns of the > country A, and B. Here, the date column is same for both countries. I want > to calculate the monthly average of both country's returns by using a loop, > and then, I want to export the results into excel. > > Please help me in this regard. > > Please find the attached datasheet. > > Thank you. > ______________________________________________ [hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|

## Re: Query about calculating the monthly average of daily data columns

Open this post in threaded view
|