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
6ec4c854
Commit
6ec4c854
authored
Nov 06, 2018
by
Jan Wijffels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add run_app
parent
34aad481
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
1 deletions
+62
-1
citizenair/DESCRIPTION
+1
-1
citizenair/NAMESPACE
+3
-0
citizenair/R/pkg.R
+2
-0
citizenair/R/runapp.R
+33
-0
citizenair/man/run_app.Rd
+23
-0
No files found.
citizenair/DESCRIPTION
View file @
6ec4c854
...
@@ -9,5 +9,5 @@ Authors@R: c(
...
@@ -9,5 +9,5 @@ Authors@R: c(
Description: Utilities for the Citizen Air application.
Description: Utilities for the Citizen Air application.
License: CC-BY-SA-4.0
License: CC-BY-SA-4.0
RoxygenNote: 6.0.1
RoxygenNote: 6.0.1
Imports: readxl, cellranger, data.table, fasttime
Imports: readxl, cellranger, data.table, fasttime
, rmarkdown, tools, utils
Suggests: sp
Suggests: sp
citizenair/NAMESPACE
View file @
6ec4c854
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
S3method(as.data.frame,citizenair)
S3method(as.data.frame,citizenair)
export(read_citizenair)
export(read_citizenair)
export(run_app)
importFrom(cellranger,cell_cols)
importFrom(cellranger,cell_cols)
importFrom(cellranger,cell_limits)
importFrom(cellranger,cell_limits)
importFrom(cellranger,cell_rows)
importFrom(cellranger,cell_rows)
...
@@ -12,6 +13,8 @@ importFrom(data.table,setnames)
...
@@ -12,6 +13,8 @@ importFrom(data.table,setnames)
importFrom(fasttime,fastPOSIXct)
importFrom(fasttime,fastPOSIXct)
importFrom(readxl,excel_sheets)
importFrom(readxl,excel_sheets)
importFrom(readxl,read_excel)
importFrom(readxl,read_excel)
importFrom(rmarkdown,run)
importFrom(tools,file_path_sans_ext)
importFrom(utils,capture.output)
importFrom(utils,capture.output)
importFrom(utils,head)
importFrom(utils,head)
importFrom(utils,tail)
importFrom(utils,tail)
citizenair/R/pkg.R
View file @
6ec4c854
#' @importFrom readxl read_excel excel_sheets
#' @importFrom readxl read_excel excel_sheets
#' @importFrom cellranger cell_rows cell_cols cell_limits
#' @importFrom cellranger cell_rows cell_cols cell_limits
#' @importFrom utils head tail capture.output
#' @importFrom utils head tail capture.output
#' @importFrom tools file_path_sans_ext
#' @importFrom data.table rbindlist melt.data.table setnames as.data.table
#' @importFrom data.table rbindlist melt.data.table setnames as.data.table
#' @importFrom fasttime fastPOSIXct
#' @importFrom fasttime fastPOSIXct
#' @importFrom rmarkdown run
NULL
NULL
citizenair/R/runapp.R
0 → 100644
View file @
6ec4c854
#' @title Run the app
#' @description Run the app
#' @param app a character string with the name of the app. Currently only 'citizenair.Rmd' is allowed.
#' @return nothing to return
#' @export
#' @examples
#' \dontrun{
#' run_app()
#' run_app('citizenair.Rmd')
#' }
run_app
<-
function
(
app
=
c
(
"citizenair.Rmd"
)){
appfolder
=
tools
::
file_path_sans_ext
(
app
)
app
<-
match.arg
(
app
)
olddir
<-
getwd
()
on.exit
({
setwd
(
olddir
)
})
# copy app to tempdir
appdir
<-
tempdir
()
setwd
(
appdir
)
dirs
<-
setdiff
(
list.dirs
(
path
=
system.file
(
"apps"
,
package
=
"citizenair"
),
recursive
=
TRUE
,
full.names
=
FALSE
),
""
)
sapply
(
dirs
,
FUN
=
function
(
x
)
dir.create
(
x
,
recursive
=
TRUE
,
showWarnings
=
FALSE
))
copyme
<-
data.frame
(
from
=
list.files
(
path
=
system.file
(
"apps"
,
package
=
"citizenair"
),
full.names
=
TRUE
,
recursive
=
TRUE
),
to
=
file.path
(
appdir
,
list.files
(
path
=
system.file
(
"apps"
,
package
=
"citizenair"
),
full.names
=
FALSE
,
recursive
=
TRUE
)),
stringsAsFactors
=
FALSE
)
mapply
(
from
=
copyme
$
from
,
to
=
copyme
$
to
,
function
(
from
,
to
){
file.copy
(
from
=
from
,
to
=
to
,
overwrite
=
TRUE
)
})
# run the app
rmarkdown
::
run
(
sprintf
(
"%s/%s"
,
appfolder
,
app
))
}
citizenair/man/run_app.Rd
0 → 100644
View file @
6ec4c854
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/runapp.R
\name{run_app}
\alias{run_app}
\title{Run the app}
\usage{
run_app(app = c("citizenair.Rmd"))
}
\arguments{
\item{app}{a character string with the name of the app. Currently only 'citizenair.Rmd' is allowed.}
}
\value{
nothing to return
}
\description{
Run the app
}
\examples{
\dontrun{
run_app()
run_app('citizenair.Rmd')
}
}
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