D_writeSolar-methods {solaR} | R Documentation |
Exporter of solaR results
Description
Exports the results of the solaR
functions as text
files using read.zoo
Usage
## S4 method for signature 'Sol'
writeSolar(object, file, complete = FALSE,
day = FALSE, timeScales = c('i', 'd', 'm', 'y'), sep = ',', ...)
Arguments
object |
A |
file |
A character with the name of the file. |
complete |
A logical. Should all the variables be exported? |
day |
A logical. Should be daily values included in the intradaily file? |
timeScales |
A character. Use 'i' to export intradaily values, 'd' for daily values, 'm' for monthly values and 'y' for yearly values. A different file will be created for each choice. |
sep |
The field separator character. |
... |
Additional arguments for |
Methods
signature(object = "Sol")
This function exports the slots with results using
write.zoo
. Ifcomplete = FALSE
andday = FALSE
(default) the result includes only the content of thesolI
slot. Itday = TRUE
the contents of thesolD
slot are included.signature(object = "G0")
If
complete = FALSE
andday = FALSE
(default) the result includes only the columns ofG0
,D0
andB0
of theG0I
slot. Ifcomplete = TRUE
it returns the contents of the slotsG0I
andsolI
. Ifday = TRUE
the daily values (slotsG0D
andsolD
) are also included.signature(object = "Gef")
If
complete = FALSE
andday = FALSE
(default) the result includes only the columns ofGef
,Def
andBef
of theGefI
slot. Ifcomplete = TRUE
it returns the contents of the slotsGefI
,G0I
andsolI
. Ifday = TRUE
the daily values (slotsGefD
,G0D
andsolD
) are also included.signature(object = "ProdGCPV")
If
complete = FALSE
andday = FALSE
(default) the result includes only the columns ofPac
andPdc
of theprodI
slot. Ifcomplete = TRUE
it returns the contents of the slotsprodI
,GefI
,G0I
andsolI
. Ifday = TRUE
the daily values (slotsprodD
,GefD
,G0D
andsolD
) are also included.signature(object = "ProdPVPS")
If
complete = FALSE
andday = FALSE
(default) the result includes only the columns ofPac
andQ
of theprodI
slot. Ifcomplete = TRUE
it returns the contents of the slotsprodI
,GefI
,G0I
andsolI
. Ifday = TRUE
the daily values (slotsprodD
,GefD
,G0D
andsolD
) are also included.
Author(s)
Oscar Perpiñán Lamigueiro
See Also
write.zoo
,
read.zoo
,
as.zooI
,
as.zooD
,
as.zooM
,
as.zooY
Examples
lat <- 37.2;
G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179)
Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2)
prom <- list(G0dm = G0dm, Ta = Ta)
prodFixed <- prodGCPV(lat = lat, dataRad = prom, modeRad = 'aguiar', keep.night = FALSE)
old <- setwd(tempdir())
writeSolar(prodFixed, 'prodFixed.csv')
dir()
zI <- read.zoo("prodFixed.csv",
header = TRUE, sep = ",",
FUN = as.POSIXct)
zD <- read.zoo("prodFixed.D.csv",
header = TRUE, sep = ",")
zD <- read.zoo("prodFixed.D.csv",
header = TRUE, sep = ",",
FUN = as.yearmon)
setwd(old)