% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read-citizendata.R
\name{read_citizenair}
\alias{read_citizenair}
\title{Read in a CitizenAir excel file}
\usage{
read_citizenair(file = system.file(package = "citizenair", "data-raw",
  "test_dummy.xls"), name = basename(file))
}
\arguments{
\item{file}{the path to the excel file}

\item{name}{the name of the file, defaults to the basename of the file}
}
\value{
an object of class \code{citizenair_userdata} which is a list with elements
\enumerate{
\item{filename: the name of the file}
\item{file: the full path to the excel file}
\item{time: the timestamp when the data was imported}
\item{content: a list where each list element contains the elements meta and data where meta and data are described below}
\item{phenomena: all measurement phenomena in the data}
}
Content element meta is a list containing
\enumerate{
\item{device: the name of the device}
\item{lat: the latitude of the device address}
\item{lon: the longitude of the device address}
\item{sheet_id: an identifier which is the sequence number of the sheet}
\item{sheet: the sheet name which was read in}
\item{phenomena: a list containing phenomena measured in the data. Each list element is a character vector with the measurement unit.}
}
Content element data is a data.frame with the measurements containing
\enumerate{
\item{datum: the date - in POSIXct format returned by readxl::read_excel when setting that field to date}
\item{time: the time - in POSIXct format returned by readxl::read_excel when setting that field to date}
\item{several columns, one for each phenomena indicated in the \code{meta} element}
}
}
\description{
Read in a CitizenAir excel file
}
\examples{
filename <- system.file(package = "citizenair", "data-raw", "citizenair-example.xls")
x <- read_citizenair(filename)
meta <- as.data.frame(x, type = "meta")
measurements <- as.data.frame(x, type = "measurements")
}
