Skip to content

Commit

Permalink
move candidate new arguments to top of function #1
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Dec 19, 2023
1 parent 341584a commit d758827
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions R/hbGIS.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ hbGIS <- function(gisdir = "",
dataset_name = "",
configfile = "",
verbose = TRUE) {
# Hard code arguments that may need to become function arguments to give control to user
groupinglocation = "school"
writeshp = FALSE
splitGIS = TRUE
writeshp = FALSE # whether to wrist a shape file
splitGIS = TRUE # whether to split sublocations (TRUE) or union them
sublocid = "OBJECTID" # column name in GIS file to identify sublocation id


#------------------------------------------------------------
lon = identifier = palms = NULL # . = was also included, but probably wrong

#===============================================
Expand Down Expand Up @@ -101,7 +106,7 @@ hbGIS <- function(gisdir = "",
fn_4 = as.character(unlist(loca[[jj]][4]))
gi2 = Nlocations + gi
loca[[gi2]] = vector("list", 4)
objectname = as.character(st_drop_geometry(shp_dat[gi, "OBJECTID"]))
objectname = as.character(st_drop_geometry(shp_dat[gi, sublocid]))
if (objectname == "NA") collect_na = c(collect_na, gi)
loca[[gi2]][[2]] = shp_dat[gi, ]
loca[[gi2]][[4]] = fn_4
Expand Down Expand Up @@ -492,7 +497,6 @@ hbGIS <- function(gisdir = "",
multimodal_fields = multimodal_fields,
trajectory_locations = trajectory_locations,
verbose = verbose)

if (length(multimodal) > 0) {
write_csv(multimodal, file = fns[4])
shp_file = paste0(palmsplus_folder, "/", dataset_name, "_multimodal.shp")
Expand Down

0 comments on commit d758827

Please sign in to comment.