I'm on MAC Rstudio version Version 1.1.453
I'm getting this error;
> runApp()
> Listening on http://127.0.0.1:4793
> Warning: Error in <-: 'names' attribute [8] must be the same length as the vector [7]
> 48: structure
> 47: server [/Users/markloessi/Data/shinny/googlebubble71820/server.R#11]
> Error in attributes(.Data) <- c(attributes(.Data), attrib) :
> 'names' attribute [8] must be the same length as the vector [7]
Here's what I'm doing;
I'm looking at incorporating my own data into this GoogleChart implementation.
Shiny - Google Charts
I am using convert("healthexp.Rds", "healthexpcsv4.xlsx") to turn RDS in XLS so I can then edit and incorporate my own data. Ultimately I'm looking to use very similar data (charging data over time) which will benefit from the animation in this example.
After converting the working RDS file to XLS if I then convert that new XLS right back to RDS (not opening XLS to edit) that new RDS file works fine. If, I open the XLS, change some of the names of countries and then save (no column changes or header changes, etc....) and convert, THAT new RDS gives me the above error.
I've worked out that some part of the saving of the XLS must be changing some attribute or parameter of the fields such that when the FACTOR'ing process occurs something is amiss (sorry not accurate language most likely).
This bit;
> data$Region <- as.factor(data$Region)
Then used here;
> shinyServer(function(input, output, session) {
>
> # Provide explicit colors for regions, so they don't get recoded when the
> # different series happen to be ordered differently from year to year.
> # http://andrewgelman.com/2014/09/11/mysterious-shiny-things/
> defaultColors <- c("#3366cc", "#dc3912", "#ff9900", "#109618", "#990099", "#0099c6", "#dd4477")
> series <- structure(
> lapply(defaultColors, function(color) { list(color=color) }),
> names = levels(data$Region)
> )
I dug around a bit on the internet, and on community.rstudio.com where I found some tidyr bits about something similar but I couldn't equate to what was going on here, although it sure looks similar.