Skip to content

getData — Error in bind_rows_(x, .id) : Column balls can't be converted from character to integer #111

@ssp3nc3r

Description

@ssp3nc3r

I received this error when retrieving data for the 2012 regular season. When I change the line of code in getData(...) from,

out <- dplyr::bind_rows(ds.list)

to

out <- do.call(rbind, lapply(ds.list, data.frame, stringsAsFactors=FALSE))

the code completes without an error, though balls and strikes are of type character so they need to be converted to integer: out <- transform(out, balls = as.integer(balls), strikes = as.integer(strikes))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions