Sf: Improve documentation/vignettes

Created on 30 Apr 2017  路  12Comments  路  Source: r-spatial/sf

Add application examples of:

  • [x] tmap #118
  • [x] mapview #118
  • [x] possibilities & challenges of using geom_sf in github version of ggplot2 #270 #311
  • [x] flexibility of spatial predicates in st_join
  • [x] st_cast examples; aggregate
  • [x] crs: how epsg exists for some, but not for all; how it is matched often, but not always, #317
  • [x] example use of, and consequences of setting (or not setting), st_agr
  • [x] secondary geometry list-columns behavior (setting, removing, making active)
  • [x] separate docs for st_intersection etc., with examples, and example of st_erase, #346
  • [x] describe what happens with sf object when sf was not loaded, #374
  • [x] better document what st_simplify does, and doesn't do, #381
  • [x] vignette 4: Manipulating simple features; aggregate/st_join/summarise ; #429

Most helpful comment

One suggestion I would make is to have st_as_sf(foo, coords = c(lon, lat)) be much more prominent in the vignette/examples. I think it is a very common workflow but I didn't discover it until I had fairly extensive sf experience.

Maybe reading in a data.frame instead of reading from meuse in the second vignette would help.

All 12 comments

One suggestion I would make is to have st_as_sf(foo, coords = c(lon, lat)) be much more prominent in the vignette/examples. I think it is a very common workflow but I didn't discover it until I had fairly extensive sf experience.

Maybe reading in a data.frame instead of reading from meuse in the second vignette would help.

I second @jsta 's suggestion.
As per bullet-point on mapview, how can I help? Do you just want to add mapview(x) calls to the examples? Or a specific vignette regarding example applications (these do exist in mapview documentation - maybe some sf data construction in those rather than the usage of the mapview example data)?

I think it would be most useful to start a new vignette on plotting: base, ggplot, mapview, tmap, pointing to their own longer materials.

For the mapview part we would need to pretty much completely point to the respective documentation chapters as the vignette will grow too large if we include too many widgets (at least if it is intended as a CRAN vignette).

Are these chapters online?

I had sth like that in mind. How do you manage your vignettes don't end up on CRAN, and how could you add a CRAN vignette that points to those on github?

Essentially, all sf has to do is create a plot vignette that makes you hungry and points to all these vignettes, right?

We don't have a CRAN vignette in mapview as I had no luck so far creating a meta-vignette that points to these. I tried with just links to these chapters, but since they are in the same package subfolder the CRAN check complains. So far, the only solution that I found for such big chapters to be acceptable for CRAN is to not have a CRAN vignette at all and state both the docs and the vignette folders in .Rbuildignore.

Rather than directories you could specify file names in .Rbuildignore, and leave one in that then points users to the external ones.

I think I tried that, but CRAN check still complained about something... I can't really remember the details, but I will re-investigate and see if I can get it to work.

I build my final pkg using the command

USER=CRAN R CMD build sf

and then conditional execution sections of R scripts could look like:

if (Sys.getenv("USER") != "CRAN")
  ...

Added vignette 5 (plotting) and 6 (miscellaneous).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

duleise picture duleise  路  3Comments

dpprdan picture dpprdan  路  4Comments

angela-li picture angela-li  路  4Comments

adrfantini picture adrfantini  路  4Comments

ekarsten picture ekarsten  路  4Comments