Skip to content

Commit

Permalink
Merge pull request #61 from levisc8/master
Browse files Browse the repository at this point in the history
Bump to tidyr 1.0.0
  • Loading branch information
AldoCompagnoni authored Oct 1, 2019
2 parents 5b61748 + f32e07a commit d05553d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Imports:
stats (>= 3.3.0),
stringr (>= 1.2.0),
tibble (>= 1.4.2),
tidyr (>= 0.6.1),
tidyr (>= 1.0.0),
utils (>= 3.3.0)
License: MIT + file LICENSE
Encoding: UTF-8
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ importFrom(stringr,str_match)
importFrom(stringr,str_split)
importFrom(tibble,as_tibble)
importFrom(tidyr,nest)
importFrom(tidyr,one_of)
importFrom(utils,View)
importFrom(utils,bibentry)
importFrom(utils,browseURL)
Expand Down
12 changes: 6 additions & 6 deletions R/browse.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ vars_spell <- function(select_columns, columns_full_tab, possibleargs){
# expand table (to nest/unnest taxonomic info)

#' @importFrom dplyr group_by %>%
#' @importFrom tidyr nest
#' @importFrom tidyr nest one_of
#' @noRd
taxa_nest <- function(x, full_tbl){

Expand Down Expand Up @@ -261,8 +261,8 @@ taxa_nest <- function(x, full_tbl){

nested_var <- taxas[which(taxas %in% names(x))]
out <- x %>%
dplyr::group_by(.dots = setdiff(names(x), taxas)) %>%
tidyr::nest(key_col = nested_var, nest_cols = nested_var)
dplyr::group_by(.dots = setdiff(names(x), taxas)) %>%
tidyr::nest(taxas = tidyr::one_of(taxas))
# Names of taxonomic lists
names(out)[2] <- nested_var
}
Expand All @@ -274,12 +274,12 @@ taxa_nest <- function(x, full_tbl){
# nest data set
out <- x %>%
dplyr::group_by(.dots = setdiff(names(x),taxas)) %>%
tidyr::nest(.key = taxas)
tidyr::nest(taxas = tidyr::one_of(taxas))
# Names of taxonomic lists
names(out$taxas) <- paste0("taxa_project_#_", out$proj_metadata_key)
names(out$taxas) <- paste0("taxa_project_", out$proj_metadata_key)

}

return(out)

}

0 comments on commit d05553d

Please sign in to comment.