I've got the st_perimeter() function working fine in RStudio running Rmarkdown chunks one by one, but when I try to knit the Rmd file to html using Knitr, it throws an error:
error in `st_perimeter_lwgeom()`:
! for perimeter of longlat geometry, cast to LINESTRING and use st_length
I'm using lwgeom_0.2-14 on Windows and the CRS of the simple features is epsg:4269.
The work-around to cast to LINESTRING and use st_length does work, and gives the same result as st_perimeter() run from the code chunk.
I'm mostly curious why st_perimeter() might work while running code chunks, but not while knitting?
I've got the
st_perimeter()function working fine in RStudio running Rmarkdown chunks one by one, but when I try to knit the Rmd file to html using Knitr, it throws an error:I'm using lwgeom_0.2-14 on Windows and the CRS of the simple features is
epsg:4269.The work-around to cast to LINESTRING and use st_length does work, and gives the same result as st_perimeter() run from the code chunk.
I'm mostly curious why
st_perimeter()might work while running code chunks, but not while knitting?