Filters FORCIS data by one or several oceans.
Arguments
- data
a
data.frame
. One obtained byread_*_data()
functions.- ocean
a
character
vector of one or several ocean names. Use the functionget_ocean_names()
to find the correct spelling.
Examples
# 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)
#> [1] 2451 77
# Get ocean names ----
get_ocean_names()
#> [1] "Arctic Ocean" "Indian Ocean" "Mediterranean Sea"
#> [4] "North Atlantic Ocean" "North Pacific Ocean" "South Atlantic Ocean"
#> [7] "South Pacific Ocean" "Southern Ocean"
# Filter by oceans ----
net_data_sub <- filter_by_ocean(net_data, ocean = "Indian Ocean")
# Dimensions of the data.frame ----
dim(net_data_sub)
#> [1] 1640 77