Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions R/chemical-APIs-batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param Projection The format and chemical detail data returned. Allowed
#' values are 'chemicaldetailall', 'chemicaldetailstandard',
#' chemicalidentifier', 'chemicalstructure', 'ntatoolkit',
#' ccdchemicaldetails'. If left empty or there is a
#' ccdchemicaldetails', 'compact'. If left empty or there is a
#' mismatch, the default format will be 'chemicaldetailstandard'.
#' @param API_key The user-specific API key
#' @param rate_limit Number of seconds to wait between each request
Expand Down Expand Up @@ -137,7 +137,8 @@ get_chemical_details_batch_2 <- function(DTXSID = NULL,
'chemicalidentifier',
'chemicalstructure',
'ntatoolkit',
'ccdchemicaldetails')
'ccdchemicaldetails',
'compact')
index <- 2
if (!is.character(Projection)){
warning('Setting `Projection` to `chemicaldetailstandard`')
Expand Down
13 changes: 9 additions & 4 deletions R/chemical-APIs.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @param Projection The format and chemical detail data returned. Allowed
#' values are 'chemicaldetailall', 'chemicaldetailstandard',
#' 'chemicalidentifier', 'chemicalstructure', 'ntatoolkit',
#' 'ccdchemicaldetails'. If left empty or there is a mismatch, the default
#' 'ccdchemicaldetails', 'compact'. If left empty or there is a mismatch, the default
#' format will be 'chemicaldetailstandard'.
#' @param API_key The user-specific API key
#' @param Server The root address for the API endpoint
Expand Down Expand Up @@ -40,7 +40,8 @@ get_chemical_details <- function(DTXSID = NULL,
'chemicalidentifier',
'chemicalstructure',
'ntatoolkit',
'ccdchemicaldetails')
'ccdchemicaldetails',
'compact')
index <- 2
if (!is.character(Projection)){
warning('Setting `Projection` to `chemicaldetailstandard`')
Expand Down Expand Up @@ -115,7 +116,7 @@ get_chemical_details <- function(DTXSID = NULL,


create_data.table_chemical_details <- function(index = -1){
if (index %in% 2:6 ){
if (index %in% 2:7 ){
if (index == 2){
data <- data.table::data.table(id = character(),
cpdataCount = integer(),
Expand Down Expand Up @@ -191,7 +192,7 @@ create_data.table_chemical_details <- function(index = -1){
expocatMedianPrediction = character(),
expocat = character(),
nhanes = character())
} else {
} else if (index == 6) {
data <- data.table::data.table(id = character(),
dtxsid = character(),
dtxcid = character(),
Expand Down Expand Up @@ -229,6 +230,10 @@ create_data.table_chemical_details <- function(index = -1){
inchikey = character(),
wikipediaArticle = character(),
cpdataCount = integer())
} else {
data <- data.table::data.table(dtxsid = character(),
casrn = character(),
preferredName = character())
}
return(data)
}
Expand Down
2 changes: 1 addition & 1 deletion man/get_chemical_details.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_chemical_details_batch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading