Code Monkey home page Code Monkey logo

Comments (5)

mdsumner avatar mdsumner commented on June 20, 2024

Just to note that read_sf also defaults to stringsAsFactors = FALSE (mainly why I use it), and can be passed to st_read for a vanilla data.frame with character vars.

Most problems I see with tibbles are about [,1] being assumed to drop = TRUE for a vanilla data frame.

from googlepolylines.

 avatar commented on June 20, 2024

@mdsumner timely response; I've just been reading the various discussions on r-spatial/sf about this.

I don't think this will be a difficult solve, just need to get motivated to do it. Mainly because all my work is in data.table and not the tidyverse.

from googlepolylines.

mdsumner avatar mdsumner commented on June 20, 2024

Cool, didn't think I had much to add - just making sure. It's clarified and galvanized somewhat for me in the last couple of years ;)

I wasn't thinking of data.table, so appreciate hearing that that impacts your views. I need to be more aware of its relationships here.

from googlepolylines.

 avatar commented on June 20, 2024

Likewise; I need to be more aware of what the rest of the world use :)

from googlepolylines.

 avatar commented on June 20, 2024

fix is inbound on branch tbldf

library(sf)
library(googlePolylines)

df_nc <- sf::st_read(system.file("shape/nc.shp", package="sf"))
tbl_nc <- sf::read_sf(system.file("shape/nc.shp", package="sf"))

enc_nc <- encode(df_nc)
enc_tbl <- encode(tbl_nc)
enc_tbl_lite <- encode(tbl_nc, strip = T)

attr(enc_nc, 'class')
attr(enc_tbl, 'class')
attr(enc_tbl_lite, 'class')

attr(enc_nc[1, ], 'class')
attr(enc_tbl[1, ], 'class')

library(googleway)

set_key("GOOGLE_MAP_KEY")

google_map() %>%
  add_polygons(data = df_nc)

google_map() %>%
  add_polygons(data = tbl_nc)

from googlepolylines.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.