Need to resolve this error from .rds file

Hi,

I am trying to read a .rds file and throwing error with a few rows. Don't know what it is and how to resolve. Please help solving the issue. I have given the link of my "factorList" file.
https://drive.google.com/drive/folders/1suTacX_ed6JNk-86pscR8sCJzSmJ5nNE?msclkid=4816425dd04111ec912cf8b4175aa93c
'''

factorList <- readRDS(file.path(dir_ls$input_dir, 'static', 'factorList.rds'))
view(factorList)

'''

When I run this code to see the FactorList file, it throws the error. I have copied from another folder and placed it again in the folder but still throws the same error and don't know how to resolve it.

Error: Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : **
** arguments imply differing number of rows: 36, 698, 50

Hi @rjha2,
Welcome to the RStudio Community Forum.

I downloaded your .RDS file into my current working directory and was able to read it with no problems:

> input.lst <- readRDS(file="factorList.rds")
> str(input.lst)
List of 3
 $ state_fact: Factor w/ 36 levels "1201","1202",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ dis_fact  : Factor w/ 698 levels "12586327","12586328",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ year_fact : Factor w/ 50 levels "1969","1970",..: 1 2 3 4 5 6 7 8 9 10 ...
> 

The contents are not a data.frame but a list of three variables as factors each with a different length.
Hope this helps.

1 Like

Thank you very much @DavoWW !!!

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.