Skip to content

Commit

Permalink
read_rgeoda has a unsolved bug as a result of rgeoda read_gal can not…
Browse files Browse the repository at this point in the history
… work well
  • Loading branch information
SpatLyu committed Jun 13, 2024
1 parent 67355e1 commit a60e580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions R/st_wt.R
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ st_summary = \(wt, ...) {
#' @importFrom rgeoda read_gwt
#' @importFrom rgeoda read_swm
#' @export
read_geoda =\(file_path,id_vec = NULL){
read_geoda = \(file_path,id_vec = NULL){
filetype = stringr::str_sub(file_path,-3,-1) %>%
stringr::str_to_lower()
switch (filetype,
Expand Down Expand Up @@ -328,17 +328,17 @@ read_geoda =\(file_path,id_vec = NULL){
#'
#' @param wt A Weight object
#' @param dsn The path of an output weights file
#' @param layer (optional) The name of the layer of input dataset,default is `""`.
#' @param id_vec (optional) Defines the unique value of each observation when saving a
#' weights file. Default is `tibble::tibble(id_v = 1:wt$num_obs)`.
#' @param layer (optional) The name of the layer of input dataset,default is `"tbf"`.
#'
#' @return A boolean value indicates if save successfully or failed
#' @importFrom tibble tibble
#' @importFrom rgeoda save_weights
#' @export
write_geoda = \(wt,dsn,layer = NULL,id_vec = NULL){
write_geoda = \(wt,dsn,id_vec = NULL,layer = NULL){
stopifnot("wt must be `Weight` object" = inherits(wt,"Weight"))
if (is.null(layer)) {layer = ""}
if (is.null(layer)) {layer = "tbf"}
if (is.null(id_vec)) {id_vec = tibble::tibble(id_v = 1:wt$num_obs)}
rgeoda::save_weights(wt,id_vec,dsn,layer)
}
Expand Down
6 changes: 3 additions & 3 deletions man/write_geoda.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a60e580

Please sign in to comment.