Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
S
statebins
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • hrbrmstr
  • statebins
  • Issues
  • #3

Closed
Open
Opened Jan 24, 2015 by hrbrmstr@hrbrmstr🛌Maintainer

using a tbl_df type (as generated by the dplyr package) causes an error

Created by: drolejoel

see http://stackoverflow.com/a/28122695/1273199

I get the error message "Error: state_data[, state_col] %in% state_coords[, merge.x] is not TRUE" when the data.frame is wrapped by the tbl_df class.

library(statebins)

t <- read.table(text= "year value state 2008 55.50628 Alabama 2008 67.52304 Alaska 2008 70.94418 Arizona 2008 57.89743 Arkansas 2008 71.40450 California 2008 75.29866 Colorado 2008 73.13052 Connecticut 2008 74.69418 Delaware", header=TRUE, stringsAsFactors=FALSE)

class(t) # data.frame statebins(t, state_col = "state", value_col = "value") # results in a statebins map

library(dplyr) # now repeat with tbl_df

t <- tbl_df(t) # convert to a tbl_df type class(t) # "tbl_df" "tbl" "data.frame" statebins(t, state_col = "state", value_col = "value") # yields this error message: "Error: state_data[, state_col] %in% state_coords[, merge.x] is not TRUE"

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: hrbrmstr/statebins#3