-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in chapter five, code chunk 6 #1085
Comments
Hi @manab-prakash -- I am unable to reproduce your issue. Please try to run the code below and let me know if it fails. library(spData)
library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.7.3, PROJ 9.2.1; sf_use_s2() is TRUE
us_states_simp2 = rmapshaper::ms_simplify(us_states, keep = 0.01,
keep_shapes = TRUE)
#> Warning in ms_de_unit(input): Coercing these 'units' columns to class numeric:
#> AREA Created on 2024-03-09 with reprex v2.0.2 |
Works fine for me too so closing for now. |
It does not run for me. Could it be the newer GDAL version? Or is it the
faulty installation? But, the code for the book worked flawlessly for
everything before this section.
library(spData)> library(sf)Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUE> #> Linking to GEOS 3.12.1, GDAL 3.7.3, PROJ 9.2.1; sf_use_s2() is TRUE> us_states_simp2 = rmapshaper::ms_simplify(us_states, keep = 0.01,+ keep_shapes = TRUE)Error: SyntaxError: Unexpected token '.'
In addition: Warning message:
In ms_de_unit(input) :
Coercing these 'units' columns to class numeric: AREA
…On Mon, Mar 11, 2024 at 4:06 AM Robin Lovelace ***@***.***> wrote:
Closed #1085 <#1085> as
completed.
—
Reply to this email directly, view it on GitHub
<#1085 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADTL6HZWZGOOWSNZGBGKPADYXTMH7AVCNFSM6AAAAABEOEWZQCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSGA3DMNJRGE3TMMQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Have you tried to run the code as one line? This error does not sound like an R error, but an external one... library(spData)
library(sf)
us_states_simp2 = rmapshaper::ms_simplify(us_states, keep = 0.01, keep_shapes = TRUE) |
Could the + be an issue? |
Well, I tried the one-liner version. It may have to do with the Linux
package thing. The code works in Windows; I tested it there, too. I was
trying to compile the book into a PDF to read since it is not available in
this part of the world. If only there was a download PDF version button on
the webpage.
…On Mon, Mar 11, 2024 at 6:27 PM Robin Lovelace ***@***.***> wrote:
rmapshaper::ms_simplify(us_states, keep = 0.01,+
Could the + be an issue?
—
Reply to this email directly, view it on GitHub
<#1085 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADTL6H7QPULHN5I6OXQCFP3YXWRCXAVCNFSM6AAAAABEOEWZQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBYGM2TEOJZGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Another idea, @manab-prakash -- are you using the current source code of the book? We do not have an object |
Yes, I tried the newer version too. The result is the same. The source of the error seems to be from C++. It is definitely not an issue from geocompr. The complete traceback is:
|
In chapter five, code chunk 6, running following :
us_states_simp2 = rmapshaper::ms_simplify(us_states2163, keep = 0.01,
keep_shapes = TRUE)
gives Error: SyntaxError: Unexpected token '.'
The text was updated successfully, but these errors were encountered: