[R] Using eigen() for extracting only few major eigenpairs

2013-01-31 Thread Pierrick Bruneau
Hi everyone, I am using eigen() to extract the 2 major eigenpairs from a large real square symmetric matrix. The procedure is already rather efficient, but becomes somehow slow for real time needs with moderately large matrices (few thousand lines). The R implementation statically extracts all

[R] Addressing results of modFit() of the FME package

2013-01-31 Thread Bachelor student
Hello, I don´t manage to address the results I get from modFit(). Would be really nice if you could help me to do so. This is my loop: for (i in 1:10) { CO2 - CO2.list[[i]] #Beobachtungen Obs - data.frame(x=t=numeric(),y=Respi=numeric()) Obs - cbind(CO2[,1],CO2[,3]) colnames(Obs) - c(x,y)

[R] I want to download garchOxFit function.

2013-01-31 Thread 박소영
Dear R help. Hello. I want to fit the model of FIGARCH on TimeSeries data. So I need to use the code of garchOxFit. I don't know how to estimate FIGARCH model. Please let me know which package I need and what is procedure of estimating FIGARCH by R. I think I need this code! gt;

[R] facet plot

2013-01-31 Thread Robin Mjelle
Hi all, I want to plot a facet plot with column names as x and column values as y. One plot for each row. here is part of my dataset: Gene T0h T0.25h T0.5h T1h T2h T3h T6h T12h T24h T48h NM_001001130 68 95 56 43 66 62 68 90 63 89 NM_001001144 0 1 4 0 1 1 1 4 1 2 NM_001001152 79 129 52 50

Re: [R] fSeries not found in R

2013-01-31 Thread Prof Brian Ripley
On 30/01/2013 21:23, Yuan, Rebecca wrote: Hello all, When I tried to install fSeries in R, I got the following error messages: install.packages(fSeries,dependencies=T) Warning message: package 'fSeries' is not available (for R version 2.15.2) Is this package changing/merging to another

Re: [R] Writing audio files (.wav) in a different directory

2013-01-31 Thread Prof Brian Ripley
On 31/01/2013 06:50, Jeff Newmiller wrote: Put the directory name into the filename string. The syntax for doing that is somewhat OS dependent, but for most cases you can use / as the separator. You really should Google file path and your OS and learn how to do this, because it is broadly

Re: [R] Percentages in bar plot

2013-01-31 Thread PIKAL Petr
Hi or use prop.table barplot(prop.table(table(stop))) Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rui Barradas Sent: Wednesday, January 30, 2013 4:01 PM To: Naser Jamil Cc: R help Subject: Re: [R]

Re: [R] I want to download garchOxFit function.

2013-01-31 Thread amarjit chandhial
  See   Dean Fantazzini (2011) Fractionally Integrated Models for Volatility: A Review - Empirical Appendix: Some Examples with R Interfaced with the Ox Package G@RCH, Moscow School of Economics; National Research University Higher School of Economics

Re: [R] converting XML document to table or dataframe

2013-01-31 Thread Franzini, Gabriele [Nervianoms]
Hello, R is good at handling XML, but in this case I would rather do the first step with an XSLT transformation, e.g. with Saxon, possibly to a CSV file. HTH, Gabriele -Original Message- From: Anika Masters [mailto:anika.mast...@gmail.com] Sent: Tuesday, January 29, 2013 3:01 AM To:

Re: [R] facet plot

2013-01-31 Thread Jose Iparraguirre
Hi Robin, You didn't provide the list with a clear structure of your data, but I hope I understood it properly. If not, it'd be easy for you to adapt what follows. I guess your data looks like this: Gene T0h T0.25h T0.5h T1h T2h T3h T6h T12h T24h T48h 1 NM_001001130 68

[R] lower corner cumulative probability

2013-01-31 Thread eliza botto
Dear useRs, With the following set of command i managed to create the copula density library(MASS) library(evd) X-matrix(sample(1:3000), ncol=2) U=cbind(rank(X[,1])/(nrow(X)+1),rank(X[,2])/(nrow(X)+1)) mat1=kde2d(U[,1],U[,2],n=150)

Re: [R] XBRL data into R?

2013-01-31 Thread Ista Zahn
Hi Anika, Have you looked at or tried the XML package? I've not used it for XBRL in particular, but have used it very successfully to parse other kinds of xml data. Best, Ista On Wed, Jan 30, 2013 at 7:19 PM, Anika Masters anika.mast...@gmail.com wrote: Has anyone explored pulling XBRL

Re: [R] lower corner cumulative probability

2013-01-31 Thread Jose Iparraguirre
Have you looked in the package 'copula'? Regards, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eliza botto Sent: 31 January 2013 11:13 To: r-help@r-project.org Subject: [R] lower

Re: [R] Package name

2013-01-31 Thread Marcio Pupin Mello
I'm not sure, but would recommend not to. -- Marcio www.dsr.inpe.br/~mello On 31/01/2013 04:26, Ortiz, John wrote: Dear list, Can I use a character to set the name of a R package? like this (-) for example (sdp-R) Thanks, John __

Re: [R] Package name

2013-01-31 Thread Duncan Murdoch
On 13-01-31 1:26 AM, Ortiz, John wrote: Dear list, Can I use a character to set the name of a R package? like this (-) for example (sdp-R) I can't quite parse your question, but I think the answer is in the Writing R Extensions manual, section 1.1 Package Structure. Duncan Murdoch

Re: [R] Please, problem using bcPower

2013-01-31 Thread John Fox
Dear Beatriz, There are several problems that combine to make the computation unstable: the small size of the numbers, the small ratio of the largest to the smallest value, the extreme negative skew of the data, and the outliers at the low end. Because of the small ratio of max(x) to min(x),

Re: [R] Using eigen() for extracting only few major eigenpairs

2013-01-31 Thread Mark Leeds
hi: the irlba package does what you're looking for. On Thu, Jan 31, 2013 at 3:32 AM, Pierrick Bruneau pbrun...@gmail.comwrote: Hi everyone, I am using eigen() to extract the 2 major eigenpairs from a large real square symmetric matrix. The procedure is already rather efficient, but becomes

[R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think a little harder on implementation style (especially to spare users complex

Re: [R] Relative Risk in logistic regression

2013-01-31 Thread Frank Harrell
I am curious why one would want risk ratios. Unlike odds ratios, they are not interpretable without reference to the base risk. For example a risk ratio of 2 cannot possibly apply to anyone with a starting risk exceeding 1/2. I think it is most helpful to use one of the existing nomograms to

Re: [R] Setting inline hook to a function identical to default in knitr turns of exponential formatting

2013-01-31 Thread mlell08
OK, i' look at this. Thank you :-) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 11:52 AM, Simon Zehnder szehn...@uni-bonn.de wrote: Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
it lets you do: (a~b~c) = foo() Mistook. should be: (a~b~c) %=% foo() because it defines the %=% operator. Barry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 3:00 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Hi Barry, this actually a good idea, to put them together! Probably even creating an object containing both of them. Haven't thought about it before. Hadley W asked for implementations of 'unstructuring assignments'

Re: [R] Modify objects in function

2013-01-31 Thread Gabor Grothendieck
On Thu, Jan 31, 2013 at 6:52 AM, Simon Zehnder szehn...@uni-bonn.de wrote: Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think

[R] Help with multiple barplots

2013-01-31 Thread Simon Kiss
Hello: I need to create a six barplots from data that looks pretty close to what appears below. There are two grouping variables (age and gender) and three dependent variables for each grouping variables. I'm not really familiar with trellis graphics, perhaps there is something that can do

Re: [R] how to use ...

2013-01-31 Thread Ivan Calandra
Dear Patrick, This is indeed a nice post to address the three dot issues. It is definitely much clearer to me now Thanks! Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06 ivan.calan...@u-bourgogne.fr

[R] Locate Patients who have multiple high blood pressure readings

2013-01-31 Thread Weijia Wang
On Thu, Jan 31, 2013 at 10:29 AM, Weijia Wang wwang@gmail.com wrote: Hi, I have a new question about subsetting in R. Say we have this data frame: PT_ID Blood_Pressure OBS_TYPE 92 1900 90.0 DBP 94 1900 90.0 DBP 174 2900 140.0 SBP 176

Re: [R] how to use ...

2013-01-31 Thread Ivan Calandra
Thanks Bert for your example. I wouldn't say that I understand why everything happens the way it does, but at least I now know what happens! I think I now need to use it and try around! Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000

[R] obtainl survival curves for single strata

2013-01-31 Thread Bond, Stephen
Dear useRs, What is the syntax to obtain survival curves for single strata on many subjects? I have a model based on Surv(time,response) object, so there is a single row per subject and no start,stop and no switching of strata. The newdata has many subjects and each subject has a strata and

[R] Regression Modeling Strategies 3-Day Short Course March 2013

2013-01-31 Thread Frank Harrell
*RMS Short Course 2013* Frank E. Harrell, Jr., Ph.D., Professor and Chair Department of Biostatistics, Vanderbilt University School of Medicine *March 4, 5 6, 2013* 8:00am - 4:30pm Student Life Center Board of Trust Room Vanderbilt University Nashville Tennessee USA See

[R] Longitudinal RelaImpo in LME4

2013-01-31 Thread Torvon
I am currently using the relaimpo package to estimate the relative importance of regressors (N= 4000): m1 - lm(y ~ x1+x2+x3+x4+x5+, data=data) calc.relimp(m1, rela=TRUE) m2=boot.relimp(m1, boot = 500, rela=TRUE, type=lmg) booteval.relimp(m2) plot(booteval.relimp(m2)) In a new dataset with 3

Re: [R] Help with multiple barplots

2013-01-31 Thread Richard M. Heiberger
Simon, I think this is what you are looking for. ###Random Data crime - sample(c('agree' ,'disagree'), replace=TRUE, size=100) guns - sample(c('agree','disagree'), replace=TRUE, size=100) climate - sample(c('agree', 'disagree'), replace=TRUE, size=100) gender - sample(c('male','both' ,'female'),

[R] rgenoud and snow

2013-01-31 Thread michele caseposta
Hello everyone. I am trying to use rgenoud in a parallel environment. While making some tests, I noticed that rgenoud seems not to be using the cluster created by makeCluster, doing all the computation in the main node. Following is the example: ncores - 5 cl - makeCluster(rep('localhost',

Re: [R] Help with multiple barplots

2013-01-31 Thread Rui Barradas
Hello, Maybe the following will help. layout(matrix(c(1,2,3,0,4,5,6), c(1,6))) Note the zero. It reserves space but no graph is put there. There is an error in your code, you plot twice guns/gender. I think the second is meant to be guns/age. Also, you can do those 6 barplot instructions

Re: [R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Dear Barry, thank you very much for this information. This looks pretty interesting! Best Simon On Jan 31, 2013, at 4:09 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: it lets you do: (a~b~c) = foo() Mistook. should be: (a~b~c) %=% foo() because it defines the %=%

[R] use name (not values!) of a dataframe inside a funktion

2013-01-31 Thread Winfried Moser
Dear Listers, can anyone help me, please. Since several days i try to figure out, how to assign values, vectors, functions etc to variables with dynamically generated names inside of functions. Sometimes I succeed, but the success is rather arbitrary, it seems. up to now i don't fully

Re: [R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Hi Barry, this actually a good idea, to put them together! Probably even creating an object containing both of them. Haven't thought about it before. Best Simon On Jan 31, 2013, at 3:49 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Thu, Jan 31, 2013 at 11:52 AM, Simon Zehnder

Re: [R] Using eigen() for extracting only few major eigenpairs

2013-01-31 Thread Pierrick Bruneau
Thanks a lot ! I'm going to try this very soon. As the package seems general purpose (ie not dedicated to real symmetric matrices), I hope it remains more efficient than the eigen function parametrized for symmetric matrices. Pierrick Bruneau CRP Gabriel Lippmann On Thu, Jan 31, 2013 at 2:51

Re: [R] Locate Patients who have multiple high blood pressure readings

2013-01-31 Thread Bert Gunter
Well, since no one has responded Please use ?dput to provide data in your posts. There are likely zillions of way to go about this. Following is one way based on ?duplicated that I think works, but I make no claims for either elegance or efficiency. Others may do lots better. But maybe it

Re: [R] Locate Patients who have multiple high blood pressure readings

2013-01-31 Thread William Dunlap
dd - # from dput() structure(list(ColA = c(92L, 94L, 174L, 176L, 180L, 268L, 268L ), PT_ID = c(1900L, 1900L, 2900L, 2900L, 3900L, 3900L, 3900L), Blood_Pressure = c(90, 90, 140, 130, 120, 150, 90), OBS_TYPE = structure(c(1L, 1L, 2L, 2L, 2L, 2L, 1L), .Label = c(DBP, SBP), class =

[R] For loop on data frame

2013-01-31 Thread Esam Tolba
I am a beginner in R. I wrote a function to read a data frame from a file and then split it into certain number of data frames and write each one of them in a separate txt file. the function is working perfectly for the first four files the it gives me files contain one column of NA values.

Re: [R] Locate Patients who have multiple high blood pressure readings

2013-01-31 Thread Gabor Grothendieck
On Thu, Jan 31, 2013 at 10:51 AM, Weijia Wang wwang@gmail.com wrote: On Thu, Jan 31, 2013 at 10:29 AM, Weijia Wang wwang@gmail.com wrote: Hi, I have a new question about subsetting in R. Say we have this data frame: PT_ID Blood_Pressure OBS_TYPE 92 1900 90.0

Re: [R] Locate Patients who have multiple high blood pressure readings

2013-01-31 Thread arun
Hi, May be this helps: #dd res-data.frame(Include=with(subset(dd,OBS_TYPE == SBP Blood_Pressure = 140|OBS_TYPE==DBP Blood_Pressure=90),apply(tapply(Blood_Pressure,list(PT_ID,OBS_TYPE),length)=2,1,any,na.rm=T))) res  #    Include #1900    TRUE #2900   FALSE #3900   FALSE A.K. -

Re: [R] For loop on data frame

2013-01-31 Thread Jeff Newmiller
Your example is not reproducible. See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example I would guess you have tabs at the ends of your lines in the input file. This is a fairly common problem when you muck with data in Excel. To find these problems

[R] LogLik of nls

2013-01-31 Thread Diviya Smith
Hello there, Can anyone point me to the code for logLik of an nls object? I found the code for logLik of an lm but could not find exactly what function is used for calculating the logLik of nls function? I am using the nls to fit the following model to data - Model 1: y ~ Ae^(-mx) + Be^(-nx) +c

Re: [R] LogLik of nls

2013-01-31 Thread Bert Gunter
methods(logLik) ## for S3 methods stats:::logLik.nls ### and look at the code! -- Bert On Thu, Jan 31, 2013 at 12:06 PM, Diviya Smith diviya.sm...@gmail.com wrote: Hello there, Can anyone point me to the code for logLik of an nls object? I found the code for logLik of an lm but could not

[R] Automated Start for new Rgui within existing R code?

2013-01-31 Thread Brigid Mooney
Is there a way to start multiple instances of R in an automated manner? Since I'm not sure that question makes tons of sense, here's my scenario: I have a number of data updates that need to be completed on an ongoing basis with the data pulled from and then stored to another location. The

Re: [R] Automated Start for new Rgui within existing R code?

2013-01-31 Thread Jeff Newmiller
?parallel::parallel Only one gui, multiple cores working at once. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] Automated Start for new Rgui within existing R code?

2013-01-31 Thread Greg Snow
You could always just run something like system(path/to/R/RScript myfile.R) from within R. But this also sounds like something that the parallel package may be helpful with to use your 8 cores to speed up your update process. On Thu, Jan 31, 2013 at 2:12 PM, Brigid Mooney bkmoo...@gmail.com

Re: [R] Package name

2013-01-31 Thread Uwe Ligges
On 31.01.2013 14:12, Duncan Murdoch wrote: On 13-01-31 1:26 AM, Ortiz, John wrote: Dear list, Can I use a character to set the name of a R package? like this (-) for example (sdp-R) I can't quite parse your question, but I think the answer is in the Writing R Extensions manual, section

[R] RODBC and datetimes

2013-01-31 Thread Dave Mitchell
I've got a data.frame I'm trying to insert into a database table in an ms sql server instance using RODBC. When I save a table using nothing but character and numeric columns things work fine. However, when I attempt to add another column of type POSIXct to the data.frame and redefine the table

Re: [R] spatial analysis

2013-01-31 Thread Rolf Turner
On 01/25/2013 10:07 AM, Rosario Garcia Gil wrote: Hello I am using library(spatstat). I managed to test of the random distribution of a collection of sampled trees in the forest. But what I want now is to test if their diameter is randomly distributed across the forest, for example the

[R] rbind Missing Something: Need New Eyes

2013-01-31 Thread Rich Shepard
I don't see what's missing in my statements to add rows to a data frame and someone else will probably see what needs to be added to the statements. The data frame has this structure (without any data): $ PHYLUM : chr $ SUBPHYLUM : chr $ SUPERCLASS : chr $ CLASS : chr $

Re: [R] rbind Missing Something: Need New Eyes [RESOLVED]

2013-01-31 Thread Rich Shepard
On Thu, 31 Jan 2013, Rich Shepard wrote: I don't see what's missing in my statements to add rows to a data frame and someone else will probably see what needs to be added to the statements. Found the problem: a FUBAR'd R session. Rich __

Re: [R] Problems Desing Package

2013-01-31 Thread Michael Weylandt
Use rms instead. MW On Jan 31, 2013, at 10:09 PM, Gabriela Agostini gabrielaagostin...@gmail.com wrote: Hi! I need to work whir Desing Package. I used library(Design) but the following error is displayed on the console library(Design, lib.loc=C:/Program

Re: [R] rbind Missing Something: Need New Eyes

2013-01-31 Thread Peter Langfelder
On Thu, Jan 31, 2013 at 3:55 PM, Rich Shepard rshep...@appl-ecosys.com wrote: I don't see what's missing in my statements to add rows to a data frame and someone else will probably see what needs to be added to the statements. The data frame has this structure (without any data): $

[R] the word rand comes up in console after typing a command

2013-01-31 Thread C W
Hi list, I keep on getting this rand word come up on my console. It shows up maybe one out 20 times I type in R console. I don't understand why it is coming up? mean(variables) [1] -0.41 rand rand rand rand rand rand rand rand rand rand rand rand rand rand rand mean(variables)

[R] help on proportions

2013-01-31 Thread Srinivas Iyyer
Hi: Apologies for asking the following question. As this may sound very basic and stupid for this forum , I honestly do not know how to solve it and I do not have a teacher who can help me understand.   I have list of genes (200) that are involved in a particular process and I call this as a 

Re: [R] the word rand comes up in console after typing a command

2013-01-31 Thread David Winsemius
Better would have been to have been following the Mac SIG mailing list. Had you been reading that list you would have known that this was investigated and fixed in the most recent release of the Mac GUI. -- David. On Jan 31, 2013, at 9:49 PM, C W wrote: Hi list, I keep on getting this

[R] Fw: D_f_norm function

2013-01-31 Thread eman kamel
- Hi every body, i am using D_f_norm function from library stat in R i am using it to find the standard deviation of the output of a function 'calculate_Z0' that has one of it is inputs as a random variable 'W' , with a standard deviation 'Sigm3LER', when i change the mean of this random

[R] glm poisson and quasipoisson

2013-01-31 Thread Wim Kreinen
Hello, I have a question about modelling via glm. I have a dataset (see dput) that looks like as if it where poisson distributed (actually I would appreciate that) but it isnt because mean unequals var. mean (x) [1] 901.7827 var (x) [1] 132439.3 Anyway, I tried to model it via poisson and

[R] D_f_norm function

2013-01-31 Thread eman kamel
Hi every body, i am using D_f_norm function from library stat in R i am using it to find the standard deviation of the output of a function 'calculate_Z0' that has one of it is inputs as a random variable 'W' , with a standard deviation 'Sigm3LER', when i change the mean of this random variable

Re: [R] Help with multiple barplots

2013-01-31 Thread Duncan Mackay
Hi Another possibility following on from Rich's example and to demonstrate what lattice can do with the latticeExtra package library(lattice) library(latticeExtra) useOuterStrips( barchart(Freq ~ Var1 | topic + category, groups=Var2, data=opinion, stack=TRUE, layout=c(3,2),

[R] weights for lmrob

2013-01-31 Thread mazlina Abu Bakar
dear experts, i hv tried to put a different weights for regression using MM-estimator by using the command: lmrob(y ~ x, weights = w2rdf) where weights are uniquely derived. somehow, R gives me Error - Weights are not yet implemented for this estimator. In S-plus, similar command lmRobMM(y~x,

[R] Transforming 4x3 data frame into 2 column df in R

2013-01-31 Thread Gundala Viswanath
I have the following data frame: foo w x y z n 1.51550092 1.4337572 1.2791624 1.1771230 q 0.09977303 0.8173761 1.6123402 0.1510737 r 1.17083866 1.2469347 0.8712135 0.8488029 What I want to do is to change it into : newdf 1 nw 1.51550092 2 q w

Re: [R] the word rand comes up in console after typing a command

2013-01-31 Thread C W
I did not closely follow the Mac SIG, but I will look into it now. Thanks for pointing it out. Mike On Thu, Jan 31, 2013 at 11:16 PM, David Winsemius dwinsem...@comcast.netwrote: Better would have been to have been following the Mac SIG mailing list. Had you been reading that list you would

[R] Question on plotCI function

2013-01-31 Thread li li
Hi all, In my plotCI function, the argument x is chosen to be seq(0.05, 0.95, by=0.05). However, when I make the plot, the plot has the x coordinate goes 1:19. Does anyone know how to make the x coordinate to be (0,0.5, 0.1, ..., 0.95). Thank you. Hanna [[alternative HTML

[R] Summary of data for each year

2013-01-31 Thread Janesh Devkota
Hello All, I have a data with two columns. In one column it is date and in another column it is flow data. I was able to read the data as date and flow data. I used the following code: creek - read.csv(creek.csv) library(ggplot2) creek[1:10,] colnames(creek) - c(date,flow) creek$date -

[R] R code parallelized using plyr and doMC: error message: Error in do.ply(i) : task 1 failed - “could not find function ”getClass“”

2013-01-31 Thread Andrew Crane-Droesch
Dear list, I'm just getting started learning how to use remote supercomputers for execution of parallelized code. I got a lot of initial help from this http://stackoverflow.com/questions/14553357/parallelizing-on-a-supercomputer-and-then-combining-the-parallel-results-r previous post, as well

Re: [R] Summary of data for each year

2013-01-31 Thread Pascal Oettli
Hello, One possibility is: creek - read.csv(creek.csv) colnames(creek) - c(date,flow) creek$date - as.Date(creek$date, %m/%d/%Y) creek - within(creek, year - format(date, '%Y')) with(creek, aggregate(flow, by=list(year=year), summary)) HTH, Pascal Le 01/02/2013 16:32, Janesh Devkota a