Skip to content

Commit

Permalink
doc: edit description & example
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Sep 6, 2024
1 parent 2ca5071 commit 79b3239
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 4 deletions.
28 changes: 26 additions & 2 deletions R/reshape_data.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#' Reshape and simplify FORCIS data
#'
#' @description
#' A short description...
#' Reshapes FORCIS data by pivoting species columns into two columns: `taxa`
#' (taxon names) and `counts` (taxon abundances). It converts wider `data.frame`
#' to a long format.
#'
#' @param data a `data.frame`, i.e. a FORCIS dataset, except for CPR North data.
#'
Expand All @@ -10,7 +12,29 @@
#' @export
#'
#' @examples
#' ## ADD EXAMPLE ----
#' # Attach the package ----
#' library("forcis")
#'
#' # Import example dataset ----
#' file_name <- system.file(file.path("extdata", "FORCIS_net_sample.csv"),
#' package = "forcis")
#'
#' net_data <- read.table(file_name, dec = ".", sep = ";")
#'
#' # Add 'data_type' column ----
#' net_data$"data_type" <- "Net"
#'
#' # Dimensions of the data.frame ----
#' dim(net_data)
#'
#' # Reshape data ----
#' net_data <- reshape_data(net_data)
#'
#' # Dimensions of the data.frame ----
#' dim(net_data)
#'
#' # Column names ----
#' colnames(net_data)

reshape_data <- function(data) {

Expand Down
28 changes: 26 additions & 2 deletions man/reshape_data.Rd

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

0 comments on commit 79b3239

Please sign in to comment.