\title{Gets a fadn.raw.csv (csv file from DG-AGRI) and transforms it accordingly to fadn.raw.rds}
\usage{
convert.to.fadn.raw.rds(
file.path = "",
sepS = ",",
fadn.year = NA,
fadn.country = NA,
keep.csv = F,
col.id = "ID"
)
}
\arguments{
\item{file.path}{the full path of the csv file (the filename must be included)}
\item{sepS}{the separator of the csv files (by default ",")}
\item{fadn.year}{the year the csv files refers to (e.g. 2001)}
\item{fadn.country}{the three letter country code the csv files refers to (e.g. "ELL")}
\item{keep.csv}{if TRUE, copy the csv files to the CSV directory; else do not copy}
}
\value{
Saves the fadn.raw.rds file and returns TRUE if everything goes well
}
\description{
It saves two files:
- One that contain a wide format of the data, i.e. in tabular format that is identical to the csv data. This is uncompressed data.
- One that holds the same information in compressed data. It is a list that contains $data.char and $data.num data.tables in long format. 0 values are removed and only the col.id is the index on both data.tables
\title{Updates selected elements of data stored in one DT with new one given in melted format}
\usage{
update_elements.DT(data.old, data.new)
}
\arguments{
\item{data.old}{The DT to update}
\item{data.new}{The data to insert. It must have three columns: {id,variable,new value}. E.g. data.new=data.table("id"=c(810001100105),"variable"=c("AASBIO_CV"),value=c(999999))}
}
\value{
a DT with the updated values
}
\description{
The user provides the data.new: {id,variable,new value}. The function overwrites all existing id-column with the new values
\title{Merges two raw_str_map files and returns either a list or a file}
\usage{
raw_str_map.merge(
source.raw_str_map.file = NULL,
new.raw_str_map.file = NULL,
return.file = F
)
}
\arguments{
\item{source.raw_str_map.file}{the filename of the source raw_str_map. It must be relative the raw_str_maps of the current data.dir}
\item{new.raw_str_map.file}{the filename of the mask raw_str_map. It will replace any entries of the source file. It must be relative the raw_str_maps of the current data.dir}
\item{return.file}{If set to T, a temporary full file path that contains the merge is returned. Otherwise a list with the contents of the merge is returned}
}
\value{
FALSE in case of problem / if return.file=T, the temporary full path of a file that contains the merged result in json / A list with the contents of the merge if return.file=F
}
\description{
All entries in the new.raw_str_map file replace those on the source.raw_str_map file
}
\details{
Both files must be relative to the current data.dir/raw_str_maps