Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
citizenair
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vmm
citizenair
Commits
ffb4ae2b
Commit
ffb4ae2b
authored
Nov 07, 2018
by
Jan Wijffels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add phenomena labels
parent
c9deeaf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
citizenair/R/read-stations.R
+2
-0
citizenair/R/utils.R
+11
-0
No files found.
citizenair/R/read-stations.R
View file @
ffb4ae2b
...
...
@@ -17,6 +17,7 @@
#' \item{lon: longitude of the station}
#' \item{lat: latitude of the station}
#' \item{phenomena: a list of phenomena identifiers for each station}
#' \item{phenomena_label: a list of phenomena labels for each station}
#' \item{timeseries: a list of timeseries identifiers for each station}
#' }
#' @examples
...
...
@@ -46,6 +47,7 @@ read_stations <- function(x = sensorweb4R::as.Endpoint("http://geo.irceline.be/s
})
stat
<-
rbindlist
(
lapply
(
sta
,
FUN
=
function
(
x
)
x
[
c
(
"id"
,
"label"
,
"lon"
,
"lat"
)]))
stat
$
phenomena
<-
lapply
(
sta
,
FUN
=
function
(
x
)
x
$
phenomena
)
stat
$
phenomena_label
<-
lapply
(
sta
,
FUN
=
function
(
x
)
txt_recode
(
x
$
phenomena
,
from
=
phe
$
id
,
to
=
phe
$
label
))
stat
$
timeseries
<-
lapply
(
sta
,
FUN
=
function
(
x
)
x
$
timeseries
)
result
<-
list
()
result
$
phenomena
<-
phe
...
...
citizenair/R/utils.R
0 → 100644
View file @
ffb4ae2b
txt_recode
<-
function
(
x
,
from
=
c
(),
to
=
c
())
{
stopifnot
(
length
(
from
)
==
length
(
to
))
nongiven
<-
unique
(
x
[
!
is.na
(
x
)])
nongiven
<-
setdiff
(
nongiven
,
from
)
if
(
length
(
nongiven
)
>
0
)
{
from
<-
append
(
x
=
from
,
values
=
nongiven
)
to
<-
append
(
x
=
to
,
values
=
nongiven
)
}
to
[
match
(
x
,
from
)]
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment