Skip to content

Commit

Permalink
Update docs with pkgdev
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 9, 2024
1 parent 9e6fba3 commit 8d75994
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
},
"SystemRequirements": null
},
"fileSize": "964.93KB",
"fileSize": "965.815KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
19 changes: 10 additions & 9 deletions vignettes/CatastRoNav.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -106,33 +106,32 @@ we created before:
# Cut buildings

dataviz <- st_intersection(pamp_bu, pamp_buff)
#> Error in UseMethod("st_intersection"): no applicable method for 'st_intersection' applied to an object of class "NULL"

ggplot(dataviz) +
geom_sf()
#> Error in eval(expr, envir, enclos): object 'dataviz' not found
```

<div class="figure">
<img src="./minimal-1.png" alt="Minimal map" width="100%" />
<p class="caption">Minimal map</p>
</div>

Let's extract now the construction year, available in the column `beginning`:


``` r
# Extract 4 initial positions
year <- substr(dataviz$beginning, 1, 4)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found

# Replace all that doesn't look as a number with 0000
year[!(year %in% 0:2500)] <- "0000"
#> Error: object 'year' not found

# To numeric
year <- as.integer(year)
#> Error in eval(expr, envir, enclos): object 'year' not found

# New column
dataviz <- dataviz %>%
mutate(year = year)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found
```

Last step is to create groups based on the year and create the data
Expand All @@ -143,12 +142,10 @@ different classes:
``` r
dataviz <- dataviz %>%
mutate(year_cat = ggplot2::cut_width(year, width = 10, dig.lab = 12))
#> Error in eval(expr, envir, enclos): object 'dataviz' not found

# Adjust the color palette

dataviz_pal <- hcl.colors(length(levels(dataviz$year_cat)), "Spectral")
#> Error in eval(expr, envir, enclos): object 'dataviz' not found

ggplot(dataviz) +
geom_sf(aes(fill = year_cat), color = NA) +
Expand All @@ -174,9 +171,13 @@ ggplot(dataviz) +
),
plot.margin = margin(r = 40, l = 40)
)
#> Error in eval(expr, envir, enclos): object 'dataviz' not found
```

<div class="figure">
<img src="./dataviz-1.png" alt="Pamplona: Urban Growth" width="100%" />
<p class="caption">Pamplona: Urban Growth</p>
</div>

## References

- Royé D (2019). "Visualize urban growth."
Expand Down
Binary file modified vignettes/dataviz-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/minimal-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8d75994

Please sign in to comment.