Skip to content

Commit

Permalink
Fixed errors in package build.
Browse files Browse the repository at this point in the history
Signed-off-by: pedroj <pedroj@me.com>
  • Loading branch information
pedroj committed Feb 9, 2025
1 parent cfe8ac0 commit bd0d533
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ License: CC0
URL: https://github.com/pedroj/FRUBASE
BugReports: https://github.com/pedroj/FRUBASE/issues
Imports:
devtools,
downloader,
knitr,
dplyr
Exports:
frubase
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Generated by roxygen2: do not edit by hand

importFrom(downloader,download)
importFrom(dplyr,filter)
importFrom(knitr,kable)
18 changes: 9 additions & 9 deletions R/frubase.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@
#'
#' @source Dataset repository \url{https://github.com/pedroj/FRUBASE}.
#'
#' @importFrom dplyr filter
#' @importFrom downloader download
#' @importFrom knitr kable
#'
#' @examples
#' # Get the data from the GitHub repository.
#' link <- "https://raw.githubusercontent.com/pedroj/FRUBASE/master/inst/extdata/frubase.tsv"
#' file <- "frubase.tsv"
#' if (!file.exists(file)) downloader::download(link, file, mode = "wb")
#' frubase <- read.table(file, sep = "\t", dec = ".",
#' header = TRUE, na.strings="NA")
#--------------------------------------------------------
#' frubase %>%
#' dplyr::filter(gen== "Vaccinium")
#' dplyr::filter(frubase, diam > 12.0)[,7]
#' by_fam.diam <- group_by(frubase, fam)
#' dplyr::summarise(by_fam.diam,
#' count = n(),
#' diam.avg = mean(diam, na.rm = TRUE),
#' diam.se = mean(diam, na.rm = TRUE))
#' head(frubase)
#' #--------------------------------------------------------
#' frubase |>
#' dplyr::filter(gen== "Prunus")
#' #--------------------------------------------------------

#'
"frubase"
16 changes: 5 additions & 11 deletions inst/analyses/FRUBASE.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ if (!has_name(frubase, "species")) {
print("Column 'species' already exists.")
}
frubase<- data.frame(frubase[,1:6], species, frubase[,7:32])
str(frubase)
```
Expand All @@ -50,21 +49,16 @@ str(frubase)

```{r filter, echo=TRUE}
require(dplyr)
frubase_df<- tibble::as_tibble(frubase)
head(frubase_df)
glimpse(frubase_df)
glimpse(frubase)
frubase_df |>
frubase |>
dplyr::filter(gen== "Prunus")
dplyr::filter(frubase_df, diam > 12.0)[,7]
by_fam.diam <- group_by(frubase, fam)
dplyr::summarise(by_fam.diam,
count = n(),
by_fam.diam <- frubase |> dplyr::group_by(fam) |>
dplyr::summarise(count = n(),
diam.avg = mean(diam, na.rm = TRUE),
diam.se = sd(diam, na.rm = TRUE) / sqrt(n()))
kable(by_fam.diam)
```

### Taxa names check
Expand Down
12 changes: 4 additions & 8 deletions man/frubase.Rd

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

0 comments on commit bd0d533

Please sign in to comment.