Learn R Programming

solaR2 (version 0.11)

A8_readBD: Daily or intradaily values of global horizontal irradiation and ambient temperature from a local file or a data.frame.

Description

Constructor for the class Meteo with values of daily or intradaily values of global horizontal irradiation and ambient temperature from a local file or a data.frame.

Usage

readBDd(file,  lat,
        format = '%d/%m/%Y',
        header = TRUE, fill = TRUE, dec = '.', sep = ';',
        dates.col = 'Dates', ta.col = 'Ta',
        g0.col = 'G0', keep.cols = FALSE, ...)

readBDi(file, lat, format = '%d/%m/%Y %H:%M:%S', header = TRUE, fill = TRUE, dec = '.', sep = ';', dates.col = 'Dates', times.col, ta.col = 'Ta', g0.col = 'G0', keep.cols = FALSE, ...)

dt2Meteo(file, lat, source = '', type)

zoo2Meteo(file, lat, source = '')

Value

A Meteo object.

Arguments

file

The name of the file (readBDd and readBDi), data.frame (or data.table) (dt2Meteo) or zoo (zoo2Meteo) which the data are to be read from. It should contain a column G0d with daily (readBDd) or G0 with intradaily (readBDi) values of global horizontal irradiation (Wh/m²). It should also include a column named Ta with values of ambient temperature. However, if the object is only a vector with irradiation values, it will converted to a data.table with two columns named G0 and Ta (filled with constant values)

If the Meteo object is to be used with calcG0 (or fCompD, fCompI) and the option corr = 'none', the file/data.frame must include three columns named G0, B0 and D0 with values of global, direct and diffuse irradiation on the horizontal plane.

Only for daily data: if the ambient temperature is not available, the file should include two columns named TempMax and TempMin with daily values of maximum and minimum ambient temperature, respectively (see fTemp for details).

header, fill, dec, sep

See fread

format

character string with the format of the dates or time index. (Default for daily time bases:%d/%m/%Y). (Default for intradaily time bases: %d/%m/%Y %H:%M:%S)

lat

numeric, latitude (degrees) of the location.

dates.col

character string with the name of the column wich contains the dates of the time series.

times.col

character string with the name of the column wich contains the time index of the series in case is in a different column than the dates.

source

character string with information about the source of the values. (Default: the name of the file).

ta.col, g0.col

character, the name of the columns with the information of ambient temperature and radiation in the provided file

keep.cols

If keep.cols=FALSE(default value), the Meteo object does not include the columns that are not important for the rest of operations

...

Arguments for fread

type

character, type of the data in dt2Meteo. To choose between 'prom', 'bd' and 'bdI'. If it is not provided, the function dt2Meteo calculate the type.

Author

Oscar Perpiñán Lamigueiro, Francisco Delgado López.

See Also

fread, readG0dm.

Examples

Run this code
library("data.table")
setDTthreads(2)

data(helios)
names(helios) = c('Dates', 'G0d', 'TempMax', 'TempMin')

bd = dt2Meteo(helios, lat = 41, source = 'helios-IES', type = 'bd')

getData(bd)

xyplot(bd)

Run the code above in your browser using DataLab