Skip to content

Commit

Permalink
[update] use latest r packages in book down
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Li <[email protected]>
  • Loading branch information
lixun910 committed Oct 25, 2023
1 parent 069ff0c commit d4a90ad
Show file tree
Hide file tree
Showing 420 changed files with 19,398 additions and 5,846 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build_bookdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

name: bookdown

jobs:
bookdown:
runs-on: macOS-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2

- name: Build site
run: bookdown::render_book("index.Rmd", quiet = TRUE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: _book
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.Rhistory
.RData
.Ruserdata
.vscode/settings.json
_bookdown_files/

.DS_Store
5 changes: 3 additions & 2 deletions 08-spatial-weights-as-distance-functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ their dependencies.^[Use
library(sf)
library(spdep)
library(geodaData)
library(spatialreg)
```


Expand Down Expand Up @@ -571,10 +572,10 @@ diag(B) <- 1
With this, we can now convert back to class **listw** with the **spdep** function `mat2listw`.
The function is pretty self explanatory, as it converts from a matrix the **listw**. We
need one extra step to accomplish the conversion. We first need to convert **B** to class
**dgTMatrix** before we can use the `mat2listw` function.
**dgRMatrix** before we can use the `mat2listw` function.

```{r quiet = TRUE}
var.band.w2 <- mat2listw(as(B, "dgTMatrix"))
var.band.w2 <- mat2listw(as(B, "dgRMatrix"))
```

#### Properties of kernal weights {-}
Expand Down
2 changes: 1 addition & 1 deletion 11-global-spatial-autocorrelation2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ out the Spatial Data Handling notebook.

```{r}
st_crs(counties)
counties <- st_transform(counties, 102003)
counties <- st_transform(counties, crs = "ESRI:102003")
```


Expand Down
Loading

0 comments on commit d4a90ad

Please sign in to comment.