2
I am saving a data frame in excel spreadsheet with the following command:
library(xlsx)
write.xlsx(df, "buildingTEPT.xlsx", sheetName = "TEPT", showNA = F, col.names = T)
It turns out that the spreadsheet already has a column that enumerates my sample. However, R is adding another column. And this is repeated every time you save. How do I not add this column, remaining only with others?
Excuse the ignorance, but I could not know which programming language you are using...
– Rodrigo Tognin
In "R" Rodrigo Tognin!
– gleidsonmr
Gleidson, I think it would be interesting to paste some part of the code that is generating the spreadsheet so that we can try to identify the reason why it is duplicating the first column...
– Rodrigo Tognin
Well. the spreadsheet was created in Excel and was imported into R with: excel_sheets('buildingTEPT.xlsx') df <- read_excel('buildingTEPT.xlsx', sheet = "TEPT") ## Then analyses were done on some data and the re-placement of some missings values. At the end, it was exported with the above line and that’s it! This column appears without header.. only numbers
– gleidsonmr
This function is explained in the R documentation: https://www.rdocumentation.org/packages/xlsx/versions/0.6.1/topics/write.xlsx
– Rodrigo Tognin