as.Json error with .RDS files

My shiny application was working fine when I read data in globally as .csv files with no issue, however, I wanted to speed up the start up of the application by using the data as .rds files instead. I've seen a couple of blog posts about speed benchmarks between read.csv and read_rds, so this seemed the way to go. However, after switching to initializing with these .rds data structures, I get this new error message:

Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported, and named vectors will be translated into arrays instead of objects. If you want JSON object output, please use a named list instead. See ?toJSON.

I have no idea what could be causing this. Does anyone have insight into this? Or is there a way that I can set options to narrow down what function is throwing this error?

Thanks for any guidance!

you could try rlang::last_error() to find a stacktrace to identify point of the error

Are you confident that the RDS files read ok?
can you read them in by calling the function on the console, and they have the contents that you expect?

I'm honestly at a loss.
I call in both the .rds and .csv files in the console, which both are working. I compare them to each other, and both seem to be the same, other than being called from different read functions. However, when I change my initial global level read from .csv to .rds, it throws the error.

I'll try that last_error() though, thanks for the recommendation

That function isn't working either, since the message is supposedly not a real "error message".

maybe drop in a browser() call after you load in the .RDS and thereby use the debug mode to step trhough line by line until you find the error line...

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.