Learn R Programming

climtrends (version 1.0.6)

FillYearlyGapsWithSomeValue: fill missing days with some value

Description

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

Usage

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.

Examples

Run this code
# 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')

Run the code above in your browser using DataLab