bcgov / bccamtrap

Managing camera trap data
https://bcgov.github.io/bccamtrap/
Apache License 2.0
2 stars 0 forks source link

mapview warning message #27

Closed btitaro closed 6 months ago

btitaro commented 6 months ago

mapview(deployments, zcol = "sample_station_label") Warning message: In clean_columns(as.data.frame(obj), factorsAsCharacter) : Dropping column(s) timelapse_time of class(es) hms;difftime

ateucher commented 6 months ago

This can be safely ignored. It's because the timelapse_time column is a special hms (hours-minutes-second) data type, which mapview doesn't know what to do with, so it drops it. In practice it means that the mapview map won't have the column in it.

We have three options:

  1. Ignore it, and/or drop that column yourself when you call mapview on it:

    library(dplyr)
    library(mapview)
    
    mapview(select(deployments, -timelapse_time), zcol = "sample_station_label")
  2. Import the timelapse_time column as a regular character type (more flexible but perhaps less useful), or you can convert it to character when you don't want it in hms format:

    deployments$timelapse_time <- as.character(deployments$timelapse_time)
  3. Open an issue upstream in the sf package, where the warning is being thrown...

btitaro commented 6 months ago

Thanks Andy - Seems like option 1 might be easiest? We can discuss with others tomorrow as well though. Thanks again for the help yesterday!

Brian


From: Andy Teucher @.> Sent: Wednesday, May 8, 2024 5:24 PM To: bcgov/bccamtrap @.> Cc: Titaro, Brian WLRS:EX @.>; Author @.> Subject: Re: [bcgov/bccamtrap] mapview warning message (Issue #27)

[EXTERNAL] This email came from an external source. Only open attachments or links that you are expecting from a known sender.

This can be safely ignored. It's because the timelapse_time column is a special hms (hours-minutes-second) data type, which mapview doesn't know what to do with, so it drops it. We have three options:

  1. Ignore it, and/or drop that column yourself when you call mapview on it:

library(dplyr) library(mapview)

mapview(select(deployments, -timelapse_time), zcol = "sample_station_label")

  1. Import the timelapse_time column as a regular character type (more flexible but perhaps less useful)

  2. Open an issue upstream in the sf package, where the warning is being thrown...

— Reply to this email directly, view it on GitHubhttps://github.com/bcgov/bccamtrap/issues/27#issuecomment-2101707848, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BHTXVTMH6C7CXQE2PIB23FDZBK62DAVCNFSM6AAAAABHNW4IISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRG4YDOOBUHA. You are receiving this because you authored the thread.Message ID: @.***>

ateucher commented 6 months ago

Agreed, option 3 would be the best, I might pursue it later down the road...