-
Notifications
You must be signed in to change notification settings - Fork 1
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 when assigning coordinates to five-number FIP code #15
Comments
Hi @MarisaBSzubryt, thanks for bringing this up. Based on that error message, yeah it looks like I'm currently working on a rewrite of the internal For (my) reference, the relevant source code causing the issue is here: Lines 90 to 103 in 21f9fc9
My initial, rough guess is that one of these two variables is causing the issue: Lines 28 to 43 in 21f9fc9
|
Hi Justin,
Thanks for getting back to me; I really appreciate your help with this and
the R package you've created! Do you know when the updates might be
published? No rush on my end or anything, was just curious if you had an
estimated time when it'll be revised. I believe that I sent the dataset
which does work (along with the one that doesn't) - let me know if it would
be helpful for me to re-send either/both if you need some test data.
Have a nice weekend!
Marisa
…On Mon, Jan 15, 2024 at 2:44 PM Justin Singh-M. - NOAA < ***@***.***> wrote:
Hi @MarisaBSzubryt <https://github.com/MarisaBSzubryt>, thanks for
bringing this up. Based on that error message, yeah it looks like
ret_index in the coord_to_fips.numeric method has a list column that is
causing the error when order is called on it. This is most likely an
issue with my internal ray casting algorithm... it's not super well-written
haha.
I'm currently working on a rewrite of the internal fipio components to
support more FIPS information (i.e. tracts, ZCTAs, etc.) so that might
delay a fix, but I will try to get something out soon.
------------------------------
For (my) reference, the relevant source code causing the issue is here:
https://github.com/program--/fipio/blob/21f9fc97e2d4e8aa1a1fb997e802254730f4251f/R/geolocate.R#L90-L103
—
Reply to this email directly, view it on GitHub
<https://github.com/program--/fipio/issues/15#issuecomment-1892745466>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFLT2IXUIZVUURCI3NOM3ZTYOWIJPAVCNFSM6AAAAABB3X53Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJSG42DKNBWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @MarisaBSzubryt, I'm going to put out a patch for this, since I think I've figured it out. Just need to do a bit more logic work -- I'd say expect a new version up on CRAN by Wednesday at the latest. The reason for the error is that in
Step (3) leaves us with two variables, r$> ret_value
[1] "04003" "04019" "04023" "35013" "35029" "48141" "48243" "48377"
r$> ret_index
[[1]]
[1] 7 9 12 13 15
[[2]]
[1] 10
[[3]]
[1] 8
[[4]]
[1] 16
[[5]]
[1] 14
[[6]]
[1] 11
[[7]]
[1] 2 3 4 5 6
[[8]]
[1] 1 I'm not sure exactly what changed, but I'm going to guess some R version modified behavior somewhere that caused either Regardless, I think I have a fix. I'll also comment once it's up on GitHub so you can install it before it's on CRAN if needed. |
@MarisaBSzubryt I was able to get the change pushed and up to CRAN today actually. fipio v1.1.2 should be up on CRAN now so the issue should be fixed now. Let me know if it's good to close this issue, thanks! |
Justin, thank you so much! The program works perfectly now. The fipio command works like a charm now |
@MarisaBSzubryt Glad to hear, and no problem! Thanks again for bringing up the issue. If any other issues come up, feel free to let me know. 😃 |
Hello,
I have been having some difficulty getting the fipio package to work properly for some (but not all of my datasets). I'm trying to take a CSV of coordinates (latitude, longitude) into five-number FIPS codes. I then would split those five number codes into the first two numbers for the state and last three numbers for the county/parish, then converting them to state/county names for automatic county-level map production. In some of the datasets I use, I get this error when running the following code:
It only happens for some CSV files or dataframes, and it doesn't seem to be a case of illegal characters in the coordinates. If I enter in the coordinates manually, it seems fine with that (usually), but bringing in a CSV downloaded from somewhere else usually (but not always) causes this error to pop up. I've spoken with one of my professors who's very familiar with R, and he couldn't figure out what's going on. The latitude and longitude are converted to vectors or numeric format prior to running this line of code (see below), so I think that sometime during the fipio::coord_to_fips() function, something is converted to a list (and should be converted back to a vector but isn't always the case). Why it only happens sometimes I'm not sure, and I wasn't sure where else to ask this sort of question.
Any thoughts on how to alleviate the issue would be greatly appreciated! Files (one works, one doesn't work) are below, along with the rest of the code,
Marisa
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
coordinates.csv
example_coordinates_simple.csv
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The text was updated successfully, but these errors were encountered: