Skip to content

Commit

Permalink
sep trait names from hidden records count
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiggi18 committed Jun 24, 2022
1 parent cf09b7d commit 61ba815
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/eoldata.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ eol_data <- function(species) {
all_ul <- rvest::html_elements(input,'ul')
trait_ul <- all_ul[[5]]
trait_list_text <- rvest::html_text2(rvest::html_nodes(trait_ul, "div"))
#space between letters and numbers
trait_list_text <- gsub("([0-9]*) records hidden", " \\1 records hidden", trait_list_text)
trait_list_text <- gsub("([0-9]*) record hidden", " \\1 record hidden", trait_list_text)
trait_list_text <- gsub('\\d* record hidden \\— show all', "", trait_list_text)
trait_list_text <- gsub('\\d* records hidden \\— show all', "", trait_list_text)
trait_list_text <- gsub('\\d* records hidden \\— show all', "", trait_list_text) # nolint

trait_list_text <- gsub('\nshow all records', "", trait_list_text)
trait_list_raw <- as.character(rvest::html_nodes(trait_ul, "div"))
Expand Down Expand Up @@ -48,4 +51,4 @@ eol_data <- function(species) {
}
}
return(trait_df)
}
}

0 comments on commit 61ba815

Please sign in to comment.