Forum Discussion
R script error when exporting data
Hey Anonymous,
Looks like that trim function doesn't exist. Try the following, it uses the "stringr" package:
library(stringr) # Write.csv (dataset.file = "PowerBIExport.csv") "Write.table (str_trim (dataset), file ="C: /Users/vitor.oliveira/Desktop/teste.txt ", sep =" \ t ", row.names = FALSE)
Hope this helps,
Alan
- Anonymous9 years agoNot applicable
Now the following error is occurring, I have installed all the packages referring to the Write function, but the ero still persists
Error Message:
R. Script Error
Error: could not find function "Write.table"
Execution stopped- alanhodgson9 years ago
Solution Supplier
Anonymous
The write.table function is in the utils package and usually is installed by default. Possible you are missing the library(utils) statement before you write the table. I don't know if it is nessecary, but it doesn't hurt to try.
Let me know if the error persists.
library(stringr) library(utils) # Write.csv (dataset.file = "PowerBIExport.csv") Write.table (str_trim (dataset), file ="C: /Users/vitor.oliveira/Desktop/teste.txt ", sep =" \ t ", row.names = FALSE)
- Anonymous9 years agoNot applicable
I tried but the same error is still occurring
I did a test with the direct script in r studio and the error log is the same