create.geotop.meteo.files: Creates geotop meteo files from (a list of) 'zoo' objects

View source: R/create.geotop.meteo.file.R

create.geotop.meteo.filesR Documentation

Creates geotop meteo files from (a list of) 'zoo' objects

Description

Creates geotop meteo files from (a list of) 'zoo' objects

Usage

create.geotop.meteo.files(
  x,
  format = "%d/%m/%Y %H:%M",
  file_prefix = "meteo",
  file_extension = ".txt",
  formatter = "%04d",
  na = "-9999",
  col.names = TRUE,
  row.names = FALSE,
  date_field = "Date",
  sep = ",",
  level = NULL,
  quote = FALSE,
  ...
)

Arguments

x

'zoo' object or a list of 'zoo' object representing the meteorological station

format

string format representing the date, see as.POSIXlt. Default is "%d/%m/%Y %H:%M" (which is the same format used in geotop.inpts keyword InitDateDDMMYYYYhhmm)

file_prefix

string containing file prefix (full path). It correspos to the value of in geotop.inpts keyword MeteoFile)

file_extension

string containing the extensions of final files. Default is c(".txt")

formatter

string value. It is the decimal formatter contained in the file name and used in case the tabular data are referred at several points. Default is "%04d" . See sprintf .

na

NA value indicator. Default is "-9999". See write.table.

col.names

logical parameter. Default is TRUE. See write.table.

row.names

logical parameter. Default is FALSE. See write.table.

date_field

string value. Default is "Date", otherwise defined by the value of HeaderDateDDMMYYYYhhmmMeteo geotop keyword.

sep

string value. Default is ",". See write.table.

level

integer argument. See get.geotop.inpts.keyword.value for major details. Default is NULL and is ignored.

quote

logical parameter. Default is TRUE. See write.table.

...

further arguments for write.table

See Also

write.table,get.geotop.inpts.keyword.value

Examples


library(geotopbricks)
data(bondone) ## It contains a "meteo" zoo object.


set.seed(12)

file_prefix <- paste(tempdir(),"meteo",sep="/") 
level=2
out <- create.geotop.meteo.files(x=meteo,file_prefix=file_prefix,level=level) 
## It exports the "meteo" zoo object into a ASCII file for GEOtop
head(readLines(out))
out





geotopbricks documentation built on May 29, 2024, 8:10 a.m.