Skip to content

Commit

Permalink
simplify argument names by removing _column
Browse files Browse the repository at this point in the history
  • Loading branch information
VLucet committed Jan 25, 2022
1 parent e4daa9d commit f4fdf3a
Show file tree
Hide file tree
Showing 42 changed files with 409 additions and 409 deletions.
32 changes: 16 additions & 16 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export("is_split<-")
export("method_func<-")
export("raw_formula<-")
export("spm_boundaries<-")
export("spm_boundary_area_column<-")
export("spm_boundary_column<-")
export("spm_boundary<-")
export("spm_boundary_area<-")
export("spm_coords_col<-")
export("spm_data<-")
export("spm_datasets<-")
Expand All @@ -20,12 +20,12 @@ export("spm_formulas<-")
export("spm_get_fit<-")
export("spm_name<-")
export("spm_patches<-")
export("spm_patches_area_column<-")
export("spm_patches_area<-")
export("spm_points<-")
export("spm_response<-")
export("spm_smoothed_data<-")
export("spm_smoothed_fit<-")
export("spm_time_column<-")
export("spm_time<-")
export("spm_unique_ID<-")
export("translated_formula<-")
export(as_discretization_method)
Expand All @@ -49,8 +49,8 @@ export(spm_aggregate_catch)
export(spm_as_boundary)
export(spm_as_dataset)
export(spm_boundaries)
export(spm_boundary_area_column)
export(spm_boundary_column)
export(spm_boundary)
export(spm_boundary_area)
export(spm_coords_col)
export(spm_data)
export(spm_datasets)
Expand All @@ -62,15 +62,15 @@ export(spm_lag)
export(spm_methods)
export(spm_name)
export(spm_patches)
export(spm_patches_area_column)
export(spm_patches_area)
export(spm_points)
export(spm_response)
export(spm_smooth)
export(spm_smooth_methods)
export(spm_smoothed_data)
export(spm_smoothed_fit)
export(spm_split)
export(spm_time_column)
export(spm_time)
export(spm_unique_ID)
export(sspm)
export(tesselate_voronoi)
Expand All @@ -86,8 +86,8 @@ exportMethods("is_split<-")
exportMethods("method_func<-")
exportMethods("raw_formula<-")
exportMethods("spm_boundaries<-")
exportMethods("spm_boundary_area_column<-")
exportMethods("spm_boundary_column<-")
exportMethods("spm_boundary<-")
exportMethods("spm_boundary_area<-")
exportMethods("spm_coords_col<-")
exportMethods("spm_data<-")
exportMethods("spm_datasets<-")
Expand All @@ -96,12 +96,12 @@ exportMethods("spm_formulas<-")
exportMethods("spm_get_fit<-")
exportMethods("spm_name<-")
exportMethods("spm_patches<-")
exportMethods("spm_patches_area_column<-")
exportMethods("spm_patches_area<-")
exportMethods("spm_points<-")
exportMethods("spm_response<-")
exportMethods("spm_smoothed_data<-")
exportMethods("spm_smoothed_fit<-")
exportMethods("spm_time_column<-")
exportMethods("spm_time<-")
exportMethods("spm_unique_ID<-")
exportMethods("translated_formula<-")
exportMethods(as_discretization_method)
Expand All @@ -124,8 +124,8 @@ exportMethods(spm_aggregate_catch)
exportMethods(spm_as_boundary)
exportMethods(spm_as_dataset)
exportMethods(spm_boundaries)
exportMethods(spm_boundary_area_column)
exportMethods(spm_boundary_column)
exportMethods(spm_boundary)
exportMethods(spm_boundary_area)
exportMethods(spm_coords_col)
exportMethods(spm_data)
exportMethods(spm_datasets)
Expand All @@ -136,14 +136,14 @@ exportMethods(spm_get_fit)
exportMethods(spm_lag)
exportMethods(spm_name)
exportMethods(spm_patches)
exportMethods(spm_patches_area_column)
exportMethods(spm_patches_area)
exportMethods(spm_points)
exportMethods(spm_response)
exportMethods(spm_smooth)
exportMethods(spm_smoothed_data)
exportMethods(spm_smoothed_fit)
exportMethods(spm_split)
exportMethods(spm_time_column)
exportMethods(spm_time)
exportMethods(spm_unique_ID)
exportMethods(sspm)
exportMethods(translated_formula)
Expand Down
24 changes: 12 additions & 12 deletions R/AAA_S4_all_classes_definitions.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,32 @@ setClass("discretization_method",
#' object(s) of class `sspm_boundary` from an `sf` object.
#'
#' @slot boundaries **\[sf\]** Spatial boundaries (polygons).
#' @slot boundary_column **\[character\]** The column of `data` that represents the
#' @slot boundary **\[character\]** The column of `data` that represents the
#' spatial boundaries.
#' @slot boundary_area_column **\[character\]** The column of `data` that represents the
#' @slot boundary_area **\[character\]** The column of `data` that represents the
#' area of spatial boundaries.
#' @slot method **\[[discretization_method][discretization_method-class]\]**
#' *(if discrete)* discretization method used.
#' @slot patches **\[sf\]** *(if discrete)* Patches resulting from
#' discretization.
#' @slot points **\[sf or NULL\]** *(if discrete)* Sample points used for
#' discretization.
#' @slot patches_area_column **\[character\]** The column of `data` that represents the
#' @slot patches_area **\[character\]** The column of `data` that represents the
#' area of patches.
#'
#' @name sspm_boundary-class
#' @rdname sspm_boundary-class
#'
setClass("sspm_boundary",
slots = list(boundaries = "sf",
boundary_column = "character",
boundary_area_column = "character")
boundary = "character",
boundary_area = "character")
)

#' @describeIn sspm_boundary-class sspm_discrete_boundary
setClass("sspm_discrete_boundary",
slots = list(method = "discretization_method",
patches_area_column = "character",
patches_area = "character",
patches = "sf",
points = "ANY"),
contains = "sspm_boundary"
Expand All @@ -89,7 +89,7 @@ setClassUnion("sspm_discrete_boundaryOrNULL", c("sspm_discrete_boundary", "NULL"
#' @slot data **\[data.frame OR sf OR tibble\]** The dataset.
#' @slot biomass **\[character\]** The biomass columns of `data`.
#' @slot density **\[character\]** The biomass density columns of `data`.
#' @slot time_column **\[character\]** The column of `data` that represents the
#' @slot time **\[character\]** The column of `data` that represents the
#' temporal dimension of the dataset.
#' @slot coords **\[character\]** The columns of `data` that represent the
#' spatial dimension of the dataset: the two columns for longitude and
Expand All @@ -114,7 +114,7 @@ setClass("sspm_dataset",
data = "ANY",
biomass = "characterOrNULL",
density = "characterOrNULL",
time_column = "character",
time = "character",
coords = "characterOrNULL",
uniqueID = "character",
boundaries = "sspm_discrete_boundary",
Expand Down Expand Up @@ -167,7 +167,7 @@ setClass("sspm_formula",
#'
#' @slot datasets **\[list\]** List of
#' [sspm_dataset][sspm_dataset-class] that define variables in the SPM model.
#' @slot time_column **\[character\]** The column of `data` that represents the
#' @slot time **\[character\]** The column of `data` that represents the
#' temporal dimension of the dataset.
# @slot biomass_var **\[character\]** The column of `datasets` that
# represents the biomass.
Expand All @@ -183,7 +183,7 @@ setClass("sspm_formula",
#' @rdname sspm-class
setClass("sspm",
slots = list(datasets = "list",
time_column = "character",
time = "character",
uniqueID = "character",
boundaries = "sspm_discrete_boundary",
smoothed_data = "ANY",
Expand All @@ -200,7 +200,7 @@ setClass("sspm",
#' The fit object for a sspm model
#'
#' @slot smoothed_data **\[ANY (sf)\]** The smoothed data.
#' @slot time_column **\[character\]** The column of `smoothed_data` that
#' @slot time **\[character\]** The column of `smoothed_data` that
#' represents the temporal dimension of the dataset.
# @slot biomass_var **\[character\]** The column of `smoothed_data` that
# represents the biomass.
Expand All @@ -215,7 +215,7 @@ setClass("sspm",
#' @rdname sspm_fit-class
setClass("sspm_fit",
slots = list(smoothed_data = "ANY",
time_column = "character",
time = "character",
uniqueID = "character",
formula = "sspm_formula",
boundaries = "sspm_discrete_boundary",
Expand Down
16 changes: 8 additions & 8 deletions R/A_accessors-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,31 +143,31 @@ setMethod("spm_smoothed_data<-",

#' @rdname sspm-accessors-methods
#' @export
setGeneric(name = "spm_time_column",
def = function(sspm_object) standardGeneric("spm_time_column")
setGeneric(name = "spm_time",
def = function(sspm_object) standardGeneric("spm_time")
)

#' @rdname sspm-accessors-methods
#' @export
setMethod("spm_time_column",
setMethod("spm_time",
signature("sspm_object" = "sspm"),
function(sspm_object) sspm_object@time_column
function(sspm_object) sspm_object@time
)

# Replacers ---------------------------------------------------------------

#' @rdname sspm-accessors-methods
#' @export
setGeneric(name = "spm_time_column<-",
def = function(object, value) standardGeneric("spm_time_column<-")
setGeneric(name = "spm_time<-",
def = function(object, value) standardGeneric("spm_time<-")
)

#' @rdname sspm-accessors-methods
#' @export
setMethod("spm_time_column<-",
setMethod("spm_time<-",
signature("object" = "sspm"),
function(object, value) {
object@time_column <- value
object@time <- value
validObject(object)
return(object)
}
Expand Down
48 changes: 24 additions & 24 deletions R/accessors-methods-sspm_boundary.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,31 +143,31 @@ setMethod("spm_points<-",

#' @rdname accessors-methods-sspm_boundary
#' @export
setGeneric(name = "spm_boundary_column",
def = function(sspm_object) standardGeneric("spm_boundary_column")
setGeneric(name = "spm_boundary",
def = function(sspm_object) standardGeneric("spm_boundary")
)

#' @rdname accessors-methods-sspm_boundary
#' @export
setMethod("spm_boundary_column",
setMethod("spm_boundary",
signature("sspm_object" = "sspm_boundary"),
function(sspm_object) sspm_object@boundary_column
function(sspm_object) sspm_object@boundary
)

# Replacers ---------------------------------------------------------------

#' @rdname accessors-methods-sspm_boundary
#' @export
setGeneric(name = "spm_boundary_column<-",
def = function(object, value) standardGeneric("spm_boundary_column<-")
setGeneric(name = "spm_boundary<-",
def = function(object, value) standardGeneric("spm_boundary<-")
)

#' @rdname accessors-methods-sspm_boundary
#' @export
setMethod("spm_boundary_column<-",
setMethod("spm_boundary<-",
signature("object" = "sspm_boundary"),
function(object, value) {
object@boundary_column <- value
object@boundary <- value
validObject(object)
return(object)
}
Expand All @@ -178,31 +178,31 @@ setMethod("spm_boundary_column<-",

#' @rdname accessors-methods-sspm_boundary
#' @export
setGeneric(name = "spm_boundary_area_column",
def = function(sspm_object) standardGeneric("spm_boundary_area_column")
setGeneric(name = "spm_boundary_area",
def = function(sspm_object) standardGeneric("spm_boundary_area")
)

#' @rdname accessors-methods-sspm_boundary
#' @export
setMethod("spm_boundary_area_column",
setMethod("spm_boundary_area",
signature("sspm_object" = "sspm_boundary"),
function(sspm_object) sspm_object@boundary_area_column
function(sspm_object) sspm_object@boundary_area
)

# Replacers ---------------------------------------------------------------

#' @rdname accessors-methods-sspm_boundary
#' @export
setGeneric(name = "spm_boundary_area_column<-",
def = function(object, value) standardGeneric("spm_boundary_area_column<-")
setGeneric(name = "spm_boundary_area<-",
def = function(object, value) standardGeneric("spm_boundary_area<-")
)

#' @rdname accessors-methods-sspm_boundary
#' @export
setMethod("spm_boundary_area_column<-",
setMethod("spm_boundary_area<-",
signature("object" = "sspm_boundary"),
function(object, value) {
object@boundary_area_column <- value
object@boundary_area <- value
validObject(object)
return(object)
}
Expand All @@ -212,31 +212,31 @@ setMethod("spm_boundary_area_column<-",

#' @rdname accessors-methods-sspm_boundary
#' @export
setGeneric(name = "spm_patches_area_column",
def = function(sspm_object) standardGeneric("spm_patches_area_column")
setGeneric(name = "spm_patches_area",
def = function(sspm_object) standardGeneric("spm_patches_area")
)

#' @rdname accessors-methods-sspm_boundary
#' @export
setMethod("spm_patches_area_column",
setMethod("spm_patches_area",
signature("sspm_object" = "sspm_discrete_boundary"),
function(sspm_object) sspm_object@patches_area_column
function(sspm_object) sspm_object@patches_area
)

# Replacers ---------------------------------------------------------------

#' @rdname accessors-methods-sspm_boundary
#' @export
setGeneric(name = "spm_patches_area_column<-",
def = function(object, value) standardGeneric("spm_patches_area_column<-")
setGeneric(name = "spm_patches_area<-",
def = function(object, value) standardGeneric("spm_patches_area<-")
)

#' @rdname accessors-methods-sspm_boundary
#' @export
setMethod("spm_patches_area_column<-",
setMethod("spm_patches_area<-",
signature("object" = "sspm_discrete_boundary"),
function(object, value) {
object@patches_area_column <- value
object@patches_area <- value
validObject(object)
return(object)
}
Expand Down
8 changes: 4 additions & 4 deletions R/accessors-methods-sspm_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ setMethod("spm_coords_col<-",

#' @rdname accessors-methods-sspm_dataset
#' @export
setMethod("spm_time_column",
setMethod("spm_time",
signature("sspm_object" = "sspm_dataset"),
function(sspm_object) sspm_object@time_column
function(sspm_object) sspm_object@time
)

# Replacers ---------------------------------------------------------------

#' @rdname accessors-methods-sspm_dataset
#' @export
setMethod("spm_time_column<-",
setMethod("spm_time<-",
signature("object" = "sspm_dataset"),
function(object, value) {
object@time_column <- value
object@time <- value
validObject(object)
return(object)
}
Expand Down
Loading

0 comments on commit f4fdf3a

Please sign in to comment.