Skip to content

Commit

Permalink
update for 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Oct 10, 2019
1 parent 9d2e82c commit ce4a4b8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
^.*\.Rproj$
^\.Rproj\.user$
^deps$
^\.RData$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ rsconnect/

*.so
*.o

deps/
25 changes: 25 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Package: rgeoda
Title: R library for spatial data analysis
Version: 0.0.3
Authors@R: person("Xun","Li", email="[email protected]", role=c("aut","cre"))
Maintainer: Xun Li <[email protected]>
Description: A package for spatial data analysis based on libgeoda and GeoDa.
Depends: R (>= 3.5.0)
License: GPL-2
Collate:
rgeoda-package.R
rgeoda.R
sf_geoda.R
read_geoda.R
weights.R
lisa.R
clustering.R
AAA.R
Imports:
wkb
RoxygenNote: 6.1.1
Encoding: UTF-8
Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
5 changes: 0 additions & 5 deletions R/sf_geoda.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ sf_to_geoda = function(sf_obj, ...) {
#' @param sp_obj An instance of sp object
#' @param with_table (Optional, Default: FALSE)If create a table from sp dataframe object.
#' @return geoda_obj An instance of GeoDa object
#' @examples
#' guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
#' library(rgdal)
#' guerry_sp <- readOGR(guerry_path)
#' guerry_gda <- sp_to_geoda(guerry_sp)
#' @export
sp_to_geoda = function(sp_obj, ...) {
if (!require("sp")) {
Expand Down
19 changes: 0 additions & 19 deletions R/weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ rook_weights <- function(geoda_obj, ...) {
#' @param is_arc (optional) FALSE (default) or TRUE, compute arc distance between two observations
#' @param is_mile (optional) TRUE (default) or FALSE, convert distance unit from mile to km.
#' @return w An instance of GeoDaWeight
#' @examples
#' guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
#' guerry <- GeoDa(guerry_path)
#' dist_thres <- gda_min_distthreshold(guerry)
#' dist_w <- distance_weights(guerry, dist_thres)
#' @export
distance_weights <- function(geoda_obj, dist_thres, ...) {
kwargs <- list(...)
Expand Down Expand Up @@ -205,11 +200,6 @@ distance_weights <- function(geoda_obj, dist_thres, ...) {
#' @param is_arc (optional) FALSE (default) or TRUE, compute arc distance between two observations
#' @param is_mile (optional) TRUE (default) or FALSE, convert distance unit from mile to km.
#' @return w An instance of Weight
#' @examples
#' guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
#' guerry <- GeoDa(guerry_path)
#' bandwidth <- gda_min_distthreshold(guerry)
#' kernel_w <- kernel_weights(guerry, bandwidth, "uniform")
#' @export
kernel_weights <- function(geoda_obj, bandwidth, kernel_method, ...) {
kwargs <- list(...)
Expand Down Expand Up @@ -247,10 +237,6 @@ kernel_weights <- function(geoda_obj, bandwidth, kernel_method, ...) {
#' @param is_arc (optional) FALSE (default) or TRUE, compute arc distance between two observations
#' @param is_mile (optional) TRUE (default) or FALSE, convert distance unit from mile to km.
#' @return w An instance of Weight
#' @examples
#' guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
#' guerry <- GeoDa(guerry_path)
#' knn_w <- knn_weights(guerry, 6)
#' @export
knn_weights <- function(geoda_obj, k, ...) {
kwargs <- list(...)
Expand Down Expand Up @@ -287,11 +273,6 @@ knn_weights <- function(geoda_obj, k, ...) {
#' @param is_arc (optional) FALSE (default) or TRUE, compute arc distance between two observations
#' @param is_mile (optional) TRUE (default) or FALSE, convert distance unit from mile to km.
#' @return w An instance of Weight
#' @examples
#' guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
#' guerry <- GeoDa(guerry_path)
#' bandwidth <- gda_min_distthreshold(guerry)
#' kernel_w <- kernel_knn_weights(guerry, 6, "uniform")
#' @export
kernel_knn_weights <- function(geoda_obj, k, kernel_method, ...) {
kwargs <- list(...)
Expand Down
2 changes: 1 addition & 1 deletion src/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ UNAME_S := $(shell uname -s)
OS_NAME := linux

RGDALLIB = ../deps/gdal_static-master
RGEODALIB = ../deps/libgeoda_static-master
RGEODALIB = ../deps/libgeoda_static-0.0.3
RWXLIB = ../deps/wx_static-master
RANNLIB = ../deps/ANN_static-master
RBOOSTLIB = ../deps/boost_static-master
Expand Down
4 changes: 2 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2.2.3
COMPILED_BY ?= gcc-4.6.3
RWINLIB = ../windows/gdal2-$(VERSION)
RGEODALIB = ../windows/libgeoda_static-0.0.1
RGEODALIB = ../windows/libgeoda_static-0.0.3
RWXLIB = ../windows/wx_static-3.0.4
RANNLIB = ../windows/ANN_static-1.1.2
RBOOSTLIB = ../windows/boost_static-1.57.0
Expand Down Expand Up @@ -49,4 +49,4 @@ winlibs:
clean:
rm -f $(SHLIB) $(OBJECTS)

.PHONY: all winlibs clean
.PHONY: all winlibs clean
4 changes: 2 additions & 2 deletions tools/libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(!file.exists("../deps/gdal_static-master/include/gdal.h")){
download.file("https://codeload.github.com/libgeoda/gdal_static/zip/master", "lib.zip", quiet = TRUE)
unzip("lib.zip", exdir = "../deps")
unlink("lib.zip")
download.file("https://codeload.github.com/rgeoda/libgeoda_static/zip/master", "geodalib.zip", quiet = TRUE)
download.file("https://github.com/rgeoda/libgeoda_static/archive/0.0.3.zip", "geodalib.zip", quiet = TRUE)
unzip("geodalib.zip", exdir = "../deps")
unlink("geodalib.zip")
download.file("https://codeload.github.com/rgeoda/wx_static/zip/master", "wxlib.zip", quiet = TRUE)
Expand All @@ -22,4 +22,4 @@ if(!file.exists("../deps/gdal_static-master/include/gdal.h")){
download.file("https://codeload.github.com/rgeoda/boost_static/zip/master", "boostlib.zip", quiet = TRUE)
unzip("boostlib.zip", exdir = "../deps")
unlink("boostlib.zip")
}
}

0 comments on commit ce4a4b8

Please sign in to comment.