fill missing days with some value

Share:

Description

FillYearlyGapsWithSomeValue fills (literally) missing years with date+some value.

Usage

1
2
FillYearlyGapsWithSomeValue(dataYearSeries,FromYear=min(dataYearSeries[,1]),
ToYear=max(dataYearSeries[,1]), missingValue=-9999)

Arguments

dataYearSeries

dataframe with climate data

FromYear

starting year

ToYear

ending year

missingValue

value representing missing data

Value

complete time series.

Author(s)

Jose Gama

Examples

1
2
3
4
5
6
7
8
# xgdcnCA008201000.dat is from ECA COLLEGEVILLE temperature
setwd(system.file('extdata/', package='climtrends'))
dailyCollegeville=ReadGHCNymd('xgdcnCA008201000.dat')
yearlyCollegeville=YearFuncFromDay(dailyCollegeville)
colnames(yearlyCollegeville) <- c('year','temperature')
yearlyCollegeville<-ValuesBetween2years(yearlyCollegeville,1918,1993)
yearlyCollegeville<-FillYearlyGapsWithSomeValue(yearlyCollegeville, missingValue=NA)
plot(yearlyCollegeville,type='l')

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.