0

This kind of question is already on Stackoverflow but it did not seem to solve my 'specific' problem.

I am imputing missing values into a dataset with the imputation package missForest. The output is a list with two elements and one of them is ximp which stores the imputed dataset. This dataset I want to save as a .Rdata file. However, R keeps giving me an error that it cannot find ximp. My code is as follows:

save(random_forest2.1$ximp, file = "random_forest21.Rdata")

The random_forest2.1 (Large missForest(2 elements, 8.7 mb)) is the object that stores and processes the imputation model.

How do I alter the save() function, so one element from that object can be saved?

MLnewby
  • 139
  • 1
  • 2
  • 8
  • When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jun 04 '18 at 17:53
  • Did you try assigning $ximp to a seperate variable first? ximp <- random_forest2.1$ximp and then save(ximp, file = "random_forest21.Rdata") – Steffen Moritz Jun 05 '18 at 15:24
  • However...as MrFlick said, with your description we can only guess. Please provide the actual ERROR MESSAGE and the rest of the code. If the error message is that ximp can't be found...there is a high certainty you already failed earlier in your code ;) – Steffen Moritz Jun 05 '18 at 15:29

0 Answers0