Skip to content

Commit

Permalink
simplified some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jooolia committed Nov 11, 2023
1 parent 59d328f commit 9c33aa3
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 40 deletions.
2 changes: 0 additions & 2 deletions R/allphenotypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#' @return data.frame of openSNP phenotypes, variants and users per phenotype, or list if `df=FALSE`
#' @examples \donttest{
#' # Get all data
#' allphenotypes(df = TRUE)
#'
#' # Output a list, then call the characteristic of interest by 'id' or
#' # 'characteristic'
#' datalist <- allphenotypes()
Expand Down
6 changes: 1 addition & 5 deletions R/download_users.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
#' @param ... Curl options passed on to [crul::HttpClient]
#' @return File downloaded to directory you specify (or default), nothing
#' returned in R.
#' @examples \dontrun{
#' @examples \donttest{
#' # Download a single user file, by id
#' download_users(id = 14)
#'
#' # Download a single user file, by user name
#' download_users(name = "kevinmcc")
#'
#' # Download many user files
#' lapply(c(14, 22), function(x) download_users(id = x))
#' read_users(id = 14, nrows = 5)
#' }
download_users <- function(name = NULL, id = NULL, dir = "~/", ...) {
if (is.null(name) && is.null(id)) {
Expand Down
2 changes: 0 additions & 2 deletions R/fetch_genotypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#'
#' @examples \donttest{
#' # get a data.frame of the users data
#' data <- users(df = TRUE)
#' head(data[[1]]) # users with links to genome data
#' mydata <- fetch_genotypes(
#' url = data[[1]][1, "genotypes.download_url"],
#' file = "~/myfile.txt"
Expand Down
2 changes: 1 addition & 1 deletion R/ncbi_snp_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ get_gene_names <- function(primary_info) {
#' ncbi_snp_query(SNPs)
#' # ncbi_snp_query("123456") ##invalid: must prefix with 'rs'
#' ncbi_snp_query("rs420358")
#' ncbi_snp_query("rs332") # warning that its merged into another, try that
#' ncbi_snp_query("rs332") # warning that its merged into another
#' ncbi_snp_query("rs121909001")
#' ncbi_snp_query("rs1837253")
#' ncbi_snp_query("rs1209415715")
Expand Down
6 changes: 0 additions & 6 deletions R/phenotypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
#' phenotypes(userid = "1,6,8", df = TRUE)
#' phenotypes(userid = "1-8", df = TRUE)
#'
#' # coerce to data.frame
#' library(plyr)
#' df <- ldply(phenotypes(userid = "1-8", df = TRUE))
#' head(df)
#' tail(df)
#'
#' # pass on curl options
#' phenotypes(1, verbose = TRUE)
#' }
Expand Down
4 changes: 0 additions & 4 deletions R/users.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#' @param ... Curl options passed on to [crul::HttpClient]
#' @return List of openSNP users, their ID numbers, and genome data if available.
#' @examples \donttest{
#' # just the list
#' data <- users(df = FALSE)
#' data
#'
#' # get a data.frame of the users data
#' data <- users(df = TRUE)
#' data[[1]] # users with links to genome data
Expand Down
2 changes: 0 additions & 2 deletions man/allphenotypes.Rd

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

6 changes: 1 addition & 5 deletions man/download_users.Rd

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

2 changes: 0 additions & 2 deletions man/fetch_genotypes.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/ncbi_snp_query.Rd

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

6 changes: 0 additions & 6 deletions man/phenotypes.Rd

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

4 changes: 0 additions & 4 deletions man/users.Rd

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

0 comments on commit 9c33aa3

Please sign in to comment.