df_to_point: df_to_point - dataframe to point

View source: R/dftosf.R

df_to_pointR Documentation

df_to_point - dataframe to point

Description

convert a dataframe with coordinates to a point feature

Usage

df_to_point(
  df,
  x = "X",
  y = "Y",
  crs,
  todisk = FALSE,
  folder = NULL,
  filename = NULL
)

Arguments

df

dataframe data

x

character name of column with x coordinates

y

character name of column with y coordinates

crs

characeter CRS in format "EPSG:XXXXX"

todisk

boolean save the sf object do disk

folder

character folder where file will be saved (must exist)

filename

character file name + extension

Value

sf object of point type

Examples

# df = data.frame(X = c(-42.3,-42.4,-42.5), Y = c(-20.1, -20.2, -20.3))
# pt1 = df_to_point(df, x = 'X', y = 'Y', crs = 'EPSG:4326',
#                todisk = TRUE, folder = './pontos',
#                filename = 'pontos.shp')

elpidiofilho/mdsFuncs documentation built on April 14, 2022, 5:40 p.m.