Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
COVID-19
models
Commits
d9709d11
Commit
d9709d11
authored
Feb 03, 2021
by
Marek Ostaszewski
Browse files
helper functions update
parent
8e8b1d48
Pipeline
#37202
passed with stages
in 4 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Integration/MINERVA_access/minerva_access_functions.R
View file @
d9709d11
...
...
@@ -9,14 +9,14 @@ library(httr)
library
(
jsonlite
)
### A convenience function to handle API queries
ask_GET
<-
function
(
fask_url
,
verbose
=
F
)
{
ask_GET
<-
function
(
fask_url
,
verbose
=
F
,
encoding
=
"UTF-8"
)
{
if
(
verbose
)
{
message
(
URLencode
(
fask_url
))
}
resp
<-
httr
::
GET
(
url
=
URLencode
(
fask_url
),
httr
::
add_headers
(
'Content-Type'
=
"application/x-www-form-urlencoded"
))
if
(
httr
::
status_code
(
resp
)
==
200
)
{
return
(
httr
::
content
(
resp
,
as
=
"text"
))
return
(
httr
::
content
(
resp
,
as
=
"text"
,
encoding
=
encoding
))
}
return
(
NULL
)
}
...
...
@@ -64,4 +64,4 @@ get_annotation <- function(freferences, ftype) {
function
(
x
)
{
ifelse
(
any
(
x
$
type
==
ftype
),
x
$
resource
[
x
$
type
==
ftype
],
NA
)
})
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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