Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_*() consistency #242

Merged
merged 37 commits into from
Apr 28, 2020
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
beced87
switched to follow (query, from, match, verbose, other_args, ...) arc…
Aariq Apr 15, 2020
742c3fa
added matcher(). Might evenutally supersede chooser().
Aariq Apr 15, 2020
55abcf9
converted CID output to character type
Aariq Apr 15, 2020
1c954b3
output is now a tibble regardless of match
Aariq Apr 15, 2020
9116472
added detail to documentation.
Aariq Apr 15, 2020
8a907a1
removed the "distance" column from the output as it doesn't provide a…
Aariq Apr 15, 2020
ca1afef
re-ordered arguments for consistency
Aariq Apr 15, 2020
d4ce609
removed unused code ("distance" column data) and switched output to t…
Aariq Apr 15, 2020
43cb3af
added verbosity to matcher util
Aariq Apr 15, 2020
dd625d2
updated documentation to add some detail
Aariq Apr 15, 2020
9cd99e2
get_wdid now outputs tibble regardless of match. match = "ask" now b…
Aariq Apr 15, 2020
d556c55
switched get_wdid() to use matcher utility function. Fixes error wit…
Aariq Apr 15, 2020
3d99c46
pass additional arguments to cs_control() via ...
Aariq Apr 15, 2020
a9b105e
added query output to matcher when match = "ask"
Aariq Apr 15, 2020
a7f75c8
add query name to matcher util
Aariq Apr 15, 2020
91fdb71
added match and verbose arguments for consistency. Refactored code a…
Aariq Apr 15, 2020
2f38d7f
updated tests. It doesn't seem like etoxid 8932 is in the database a…
Aariq Apr 16, 2020
766590a
updated tests
Aariq Apr 16, 2020
929befb
updated tests
Aariq Apr 16, 2020
38707d6
minor changes to get functions working
Aariq Apr 16, 2020
0454d5a
deal with NAs correctly/better
Aariq Apr 16, 2020
9648589
rebuild documentation
Aariq Apr 16, 2020
4aa3b61
updated branch from master
Aariq Apr 16, 2020
c75ade4
code styling mostly
Aariq Apr 16, 2020
4ceccdb
changed output to tibble
Aariq Apr 16, 2020
1f6b14c
update news
Aariq Apr 20, 2020
ae21765
merging
Aariq Apr 22, 2020
2c6dd96
documented matcher util in code (no rd, no export)
Aariq Apr 22, 2020
d46f007
Merge branch 'master' into get_consistency
Aariq Apr 23, 2020
2db7a8d
removed dependency for tidyr, switched an instance of purrr::map() to…
Aariq Apr 23, 2020
9d8d054
Merge branch 'get_consistency' of https://github.com/Aariq/webchem in…
Aariq Apr 23, 2020
9a83f0a
Merge branch 'master' into get_consistency
Aariq Apr 26, 2020
3080289
repaired bad merge
Aariq Apr 27, 2020
4087f4c
get_etoxid no longer warns when SYNONYM returned instead of ETOX_NAME.
Aariq Apr 27, 2020
9af211b
fix dependencies
Aariq Apr 27, 2020
abcca4c
rebuilt docs
Aariq Apr 27, 2020
7b1c8d8
fixed examples to run with new get_ functions
Aariq Apr 27, 2020
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
Prev Previous commit
Next Next commit
converted CID output to character type
  • Loading branch information
Aariq committed Apr 15, 2020
commit 55abcf96b17c72b66de98e9f223a894e8267d99c
10 changes: 5 additions & 5 deletions R/pubchem.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
get_cid <-
function(query,
from = c("name", "cid", "sid", "aid", "smiles", "inchi", "inchikey"),
match = c("all", "best", "first", "ask", "na"),
match = c("all", "first", "ask", "na"),
verbose = TRUE,
search_substances = FALSE,
arg = NULL,
Expand Down Expand Up @@ -109,13 +109,13 @@ get_cid <-
cont <- cont$InformationList$Information$CID
}
out <- unique(unlist(cont))
if (match == "first")
out <- out[1]
out <- matcher(out, match)
out <- as.character(out)
names(out) <- NULL
return(out)
}

out <- map_chr(query,
out <- map(query,
~foo(query = .x, from = from, match = match,
verbose = verbose, arg = arg))
out <- setNames(out, query)
Expand All @@ -130,7 +130,7 @@ get_cid <-
out <- map(out, unique)
}


#TODO: replace with converting output to tibble regardless of match
if (match == "first") {
out <- unlist(out)
}
Expand Down