import: Import Data

importR Documentation

Import Data

Description

Import from one object into another.

Usage

import(x, ...) <- value

## S3 replacement method for class 'data.frame'
import(x, variables, fill.na, group, ...) <- value

Arguments

x

Target object.

...

Other parameters (not used).

value

Object containing catch data to be assigned.

variables

Character string(s) specifying the fields to import from the source object.

fill.na

Value to be used to fill in target field entries with no matching source entries.

group

Grouping variable.

See Also

match

Examples

## Not run: 
library(gulf.data)

# Import snow crab survey by-catch data:
x <- read.scsset(year = 2020, valid = 1)
y <- read.scscat(year = 2020, species = c("cod", "plaice"))
y$species <- species(y$species)
import(x, fill = 0, var = "number.caught", group = "species") <- y

# Import snow crab category data:
x <- read.scsset(year = 2020, valid = 1)
b <- read.scsbio(2020)
import(x, fill = 0) <- catch(b, category = c("M", "COM", "MF"))
print(x$M)

## End(Not run)

TobieSurette/gulf.utils documentation built on Dec. 1, 2024, 6:01 a.m.