Skip to content

Commit

Permalink
change output format of scrapenames to tibble
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Foster committed Oct 29, 2024
1 parent bf07823 commit 945e5e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/scrapenames.r
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ scrapenames <- function(
}

# Parse and return results
raw_output <- response$parse("UTF-8")
switch (format,
csv = read.csv(text = response$parse("UTF-8")),
tsv = read.csv(text = response$parse("UTF-8"), sep = '\t'),
json = jsonlite::fromJSON(response$parse("UTF-8")),
csv = tibble::as_tibble(read.csv(text = raw_output)),
tsv = tibble::as_tibble(read.csv(text = raw_output, sep = '\t')),
json = jsonlite::fromJSON(raw_output),
other = stop("Invalid 'format' option.")
)
}

0 comments on commit 945e5e3

Please sign in to comment.