Learn R Programming

fgeo.tool (version 1.2.9)

from_var_to_var: Functions to get variables from other variables.

Description

These functions wrap their corresponding functions from the CTFS R Package, but these versions are stricter. The main differences are these:

  • names use "_" not ".".

  • argument gridsize defaults to missing to force the user to provide it.

  • If the argument plotdim is missing from functions gxgy_fun(), its value will be guessed and notified.

Usage

rowcol_to_index(rowno, colno, gridsize, plotdim)

index_to_rowcol(index, gridsize, plotdim)

gxgy_to_index(gx, gy, gridsize, plotdim)

gxgy_to_lxly(gx, gy, gridsize, plotdim)

gxgy_to_qxqy(gx, gy, gridsize, plotdim)

gxgy_to_rowcol(gx, gy, gridsize, plotdim)

gxgy_to_hectindex(gx, gy, plotdim)

index_to_gxgy(index, gridsize, plotdim)

Value

A vector or dataframe (see examples).

Arguments

rowno, colno

Row and column number -- as defined in a census plot.

gridsize

The gridsize of the census plot (commonly 20 m).

plotdim

The global dimensions of the census plot (i.e. the maximum possible values of gx and gy).

index

Index number as defined for a census plot.

gx, gy

A number; global x and y position in a census plot.

Author

Rick Condit, Suzanne Lao.

Details

gxgy_to_qxqy() didn't exist in the original CTFS R Package. Added for consistency.

Examples

Run this code
gxgy_to_index(c(0, 400, 990), c(0, 200, 490), gridsize = 20)

gridsize <- 20
plotdim <- c(1000, 500)

x <- gxgy_to_hectindex(1:3, 1:3, plotdim)
x
typeof(x)
is.data.frame(x)
is.vector(x)

x <- gxgy_to_index(1:3, 1:3, gridsize, plotdim)
x
typeof(x)
is.data.frame(x)
is.vector(x)

x <- gxgy_to_lxly(1:3, 1:3, gridsize, plotdim)
x
typeof(x)
is.data.frame(x)
is.vector(x)

x <- gxgy_to_rowcol(1:3, 1:3, gridsize, plotdim)
x
typeof(x)
is.data.frame(x)
is.vector(x)

x <- index_to_rowcol(1:3, gridsize, plotdim)
x
typeof(x)
is.data.frame(x)
is.vector(x)

x <- rowcol_to_index(1:3, 1:3, gridsize, plotdim)
x
typeof(x)
is.data.frame(x)
is.vector(x)

index_to_gxgy(1:3, gridsize, plotdim)

Run the code above in your browser using DataLab