Skip to content

Commit

Permalink
minor formatting differences in documentation and structure (e.g. F t…
Browse files Browse the repository at this point in the history
…o FALSE, spaces added, etc)
  • Loading branch information
bmaitner committed Feb 22, 2022
1 parent 67ba4a8 commit 7dd95e3
Show file tree
Hide file tree
Showing 29 changed files with 603 additions and 378 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.2.5
Date: 2022-02-21 22:34:33 UTC
SHA: 67ba4a8b5570bed36553e7d14e7e653413574267
391 changes: 257 additions & 134 deletions R/BIEN.R

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions R/BIEN_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ NULL
###################


.onAttach <- function(libname,pkgname) {
.onAttach <- function(libname, pkgname) {
packageStartupMessage('Type vignette("BIEN") or vignette("BIEN_tutorial") to get started')


suppressWarnings(x <- try(readLines("https://raw.githubusercontent.com/bmaitner/RBIEN/master/NOTES", warn = F), silent = T))
suppressWarnings(x <- try(readLines("https://raw.githubusercontent.com/bmaitner/RBIEN/master/NOTES", warn = FALSE), silent = TRUE))
if(class(x)=="character"){
if(length(x) != 0){
packageStartupMessage(x, appendLF = T)
packageStartupMessage(x, appendLF = TRUE)

}

Expand Down
59 changes: 45 additions & 14 deletions R/BIEN_sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if(print.query){

query <- gsub(pattern = "\n",replacement = "",query)
query <- gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", query, perl=TRUE)
query <- gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", query, perl = TRUE)
print(query)

}
Expand All @@ -78,83 +78,114 @@
if(!is.null(view_full_occurrence_individual)){

#query<-gsub(pattern = "\\<view_full_occurrence_individual\\>",replacement = view_full_occurrence_individual,x = query)}
query <- gsub(pattern = "(?<!as |AS )(?<!\\S)view_full_occurrence_individual(?!\\S)",replacement = view_full_occurrence_individual,x = query,perl = T)
query <- gsub(pattern = "(?<!as |AS )(?<!\\S)view_full_occurrence_individual(?!\\S)",
replacement = view_full_occurrence_individual,
x = query,
perl = TRUE)

}


if(!is.null(plot_metadata)){

#query<-gsub(pattern = "\\<view_full_occurrence_individual\\>",replacement = view_full_occurrence_individual,x = query)}
query <- gsub(pattern = "(?<!as |AS )(?<!\\S)plot_metadata(?!\\S)",replacement = plot_metadata,x = query,perl = T)
query <- gsub(pattern = "(?<!as |AS )(?<!\\S)plot_metadata(?!\\S)",
replacement = plot_metadata,
x = query,
perl = TRUE)

}

if(!is.null(analytical_stem)){

#query<-gsub(pattern = "\\<view_full_occurrence_individual\\>",replacement = view_full_occurrence_individual,x = query)}
query <- gsub(pattern = "(?<!as |AS )(?<!\\S)analytical_stem(?!\\S)",replacement = analytical_stem,x = query,perl = T)
query <- gsub(pattern = "(?<!as |AS )(?<!\\S)analytical_stem(?!\\S)",
replacement = analytical_stem,
x = query,
perl = TRUE)

}

if(!is.null(agg_traits)){

query <- gsub(pattern = "agg_traits",replacement = agg_traits,x = query)
query <- gsub(pattern = "agg_traits",
replacement = agg_traits,
x = query)

}

if(!is.null(species_by_political_division)){

query <- gsub(pattern = "species_by_political_division",replacement = species_by_political_division,x = query)
query <- gsub(pattern = "species_by_political_division",
replacement = species_by_political_division,
x = query)

}

if(!is.null(bien_species_all)){

query <- gsub(pattern = "bien_species_all",replacement = bien_species_all,x = query)
query <- gsub(pattern = "bien_species_all",
replacement = bien_species_all,
x = query)
}

if(!is.null(ranges)){

query <- gsub(pattern = "ranges",replacement = ranges,x = query)
query <- gsub(pattern = "ranges",
replacement = ranges,
x = query)

}

if(!is.null(bien_taxonomy)){

query <- gsub(pattern = "bien_taxonomy",replacement = bien_taxonomy,x = query)
query <- gsub(pattern = "bien_taxonomy",
replacement = bien_taxonomy,
x = query)

}

if(!is.null(phylogeny)){

query <- gsub(pattern = "\\<phylogeny\\>",replacement = phylogeny,x = query)
query <- gsub(pattern = "\\<phylogeny\\>",
replacement = phylogeny,
x = query)

}

if(!is.null(bien_metadata)){

query <- gsub(pattern = "\\<bien_metadata\\>",replacement = bien_metadata,x = query)
query <- gsub(pattern = "\\<bien_metadata\\>",
replacement = bien_metadata,
x = query)

}


if(!is.null(datasource)){

query <- gsub(pattern = "(?<=\\s)datasource(?=\\s)",replacement = datasource,x = query,perl = T)
query <- gsub(pattern = "(?<=\\s)datasource(?=\\s)",
replacement = datasource,
x = query,
perl = TRUE)

}

if(!is.null(centroid)){

query <- gsub(pattern = "(?<=\\s)centroid(?=\\s)",replacement = datasource,x = query,perl = T)
query <- gsub(pattern = "(?<=\\s)centroid(?=\\s)",
replacement = datasource,
x = query,
perl = TRUE)

}


if(!is.null(limit)){

query <- gsub(pattern = " ;",replacement = paste(" LIMIT ",limit,";"),x = query)
query <- gsub(pattern = " ;",
replacement = paste(" LIMIT ",limit,";"),
x = query)

}

Expand Down
Loading

0 comments on commit 7dd95e3

Please sign in to comment.