4
I need to add new information to the xls spreadsheet, but this already has information that was previously inserted. I need that data to be on the same sheet.
There is the possibility to update a spreadsheet without overwriting the data that already exist?
I am using write.xls as simply as possible:
write.xlsx(obj, path, sheetName="Dados")
I tried to use the append, but it always overrides or creates the data on a different sheet. There’s another way to do this?
Do you have to necessarily save in . xlsx? It is much more practical to work with outputs in . csv, in R.
– Molx
I’ll test, @Molx. I don’t have to use xlsx.
– Samara
The problem is that not all my data has the same amounts of lines. For example, I have a set with 3 lines. Then I need to add another set with 4 lines.. the only thing in common is that everyone has information (x,y). But then when I try to use . csv he complains that the amount of information is not compatible.
– Samara
You can append using . csv regardless of the number of lines. Maybe the problem is in trying to write headers or Row Numbers, hence the error. It might be a good idea to consider such an approach next time, as this problem is solved.
– Molx
I’ll test, even if the other one worked, @Molx :)
– Samara
@Molx worked super well even and is much simpler! : ) Thank you so much for your good ideas.
– Samara
Great! R does not like xls, so it is good to avoid, especially as output. Text files are simpler and easier to work with.
– Molx