Re: [R] Help/ Mathematics

2017-06-22 Thread Ahmed Attia
Hi Jim, Thank you very much, this was so helpful. GPP_Ahmed13$Date <- as.Date(GPP_Ahmed13$Date, '%Y/%m/%d') Litterfall_Ahmed97$Date <- as.Date(Litterfall_Ahmed97$Date, '%Y/%m/%d') leafbiom97$Date <- as.Date( leafbiom97$Date, '%Y/%m/%d') (leafbiom97$LeafBiog[leafbiom97$Date == "2012-02-12"] -

Re: [R] Help/ Mathematics

2017-06-21 Thread David Winsemius
> On Jun 21, 2017, at 11:19 AM, Ahmed Attia wrote: > > Hi R users, > > I need your help to write a code in r that does the following > calculation from three different datasets; > > ac = 1/sum (NPP from date 1 to date 2, dataset=1) * (biomass at date 2 > -biomass at

Re: [R] Help/ Mathematics

2017-06-21 Thread Jim Lemon
Hi Ahmed, Your problem appears trivial as you have already specified the form of the calculation. Learn how to "extract" specified elements from a data structure: # first value sum(dataset1$NPP[dataset1$date >= date1 & dataset1$date <= date2]) # second value dataset2$biomass[dataset2$date ==

Re: [R] Help/ Mathematics

2017-06-21 Thread Bert Gunter
We expect posters to have made an effort to learn R and show us code that they have tried. We do not provide free software development. The "Introduction to R" tutorial that ships with the software is one place to start, but there are many good web tutorials also available. Just search. Cheers,

[R] Help/ Mathematics

2017-06-21 Thread Ahmed Attia
Hi R users, I need your help to write a code in r that does the following calculation from three different datasets; ac = 1/sum (NPP from date 1 to date 2, dataset=1) * (biomass at date 2 -biomass at date 1, dataset = 2) + (littfall at date 2, dataset=3). all the dates are in yr-month-day