Learn R Programming

ClimClass (version 2.1.0)

as.datcli: as.datcli

Description

Tranforms a data frame (see example dataset) into a data frame format like 'datcli' in 'climatol' package

Usage

as.datcli(df, station, MonthField = "month", PrecField = "P", MinTempField = "Tn", MaxTempField = "Tx", MeanTempField = "Tm", AbsMinTempField = "AbsTn", AbsMinTempOffset = 4, StationField = "station")

Arguments

df
data frame or list
station
name
MonthField
character string for month field in df. Default is "month".
PrecField
character string for Mean Precipitation field in df. Default is "P".
MinTempField
character string for Mean Daily Minimum Temperature field in df. Default is "Tn".
MaxTempField
character string for Mean Daily Maximum Temperature field in df. Default is "Tx".
MeanTempField
character string for Mean Daily Maximum Temperature field in df. Default is "Tm".
AbsMinTempField
character string for Absolute Monthly Minimum Temperature field in df. Default is "AbsTn".
AbsMinTempOffset
estimated offset between Average Min Temperature and Absolute Min Temperature.
StationField
character string for Station field in df. Default is "station".

See Also

www.climatol.eu, http://www.zoolex.org/walter.html

Examples

Run this code

### Not Run!! 
# Install 'climatol' from 'http://www.climatol.eu/' first
### Then load the package, uncomment and run the following line
# library(climatol)
	library(stringr)
 data(Trent_climate)

 TrentinoClimateDf <- do.call(rbind,clima_81_10)
 names <- rownames(TrentinoClimateDf)
 TrentinoClimateDf$station <- 
 unlist(lapply(X=str_split(names,pattern="[.]"),FUN=function(x) {x[1]}))
 

 station <- "T0129"
datcli <- as.datcli(TrentinoClimateDf,station=station)

### Not Run!! 
# Install 'climatol' from 'http://www.climatol.eu/' first
### Then load the package, uncomment and run the following line
# diagwl(datcli,est=station,alt=100,per="Period",mlab="en") ## plots a Walter-Lieth's climograph

Run the code above in your browser using DataLab