Skip to content
Prev 369943 / 398503 Next

Help/ Mathematics

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 == date2] -
 dataset2$biomass[dataset2$date == date1]
# third value
dataset3$littfall[dataset3$date == date2]

Note that you may have to convert character strings to dates to do the
above - see a function like "as.Date". Obviously I do not know the
actual names of your datasets and I am assuming that the variable
names you have given are the actual ones.

Jim
On Thu, Jun 22, 2017 at 4:19 AM, Ahmed Attia <ahmedatia80 at gmail.com> wrote: