I have a report that all it does is export it's data to excel via power automate using some R code.
"write_xlsx(dataset,"file_path.xlsx")"
However, I need to manipulate it further and it needs to be in a tabular format to do so. Yet, when I try "write.table" I get the error that my connection to OneDrive is not open. So I can export an Excel sheet with the data, but not the same data as a Table.
Any ideas?
Related
I use the following function from the openxlsx package to export my dataframe to a local folder as an xlsx file:
write.xlsx(data frame, path, overwrite = TRUE)
I want to pull it into a Power BI project, but when I do, I get the following error from Power BI:
"The input couldn't be recognized as a valid Excel document."
But when I go into the file, save it and close, it then works fine.
Thank you
How can I save data in an R compressed file format and then open it in Excel Power Query? I've opened in PowerBI Power Query no problem by setting the R path and using R.Execute(), but Power Query in Excel only has an RData.FromBinary() function.
Hopefully it can be loaded into Excel without any external dependencies as I'd like to switch from accdb files on a shared drive for the purpose of sharing easily refreshable data sets.
I tried exporting with these 3 methods:
saveRDS(tmp, "c:/users/ian/Documents/CRAN_mirrors.rds")
save(tmp, file="c:/users/ian/Documents/CRAN_mirrors.RData")
save.image(file="c:/users/ian/Documents/CRAN_mirrors.RData")
And tried importing with both:
= RData.FromBinary(File.Contents("C:\Users\ian\Documents\CRAN_mirrors.rds"))
and
= RData.FromBinary(File.Contents("C:\Users\ian\Documents\CRAN_mirrors.RData"))
Either of those import attempts gives me the following error:
DataFormat.Error: Exception of type 'Microsoft.Analytics.Modules.R.ErrorHandling.RException.Primitives.NotValidRDataException' was thrown.
I have had problems uploading the following file to Tableau:
https://www.kaggle.com/datasets/shivamb/netflix-shows/download
When loaded it looks like this
but loading it in R
Is it possible to load them in R and then by Rserve connect to tableau or is there a way to load them fine
Looks like a problem within the interpreter.
I can't download the file myself as I don't have a Kaggle account, and its not clear from you R screenshots, though you could adjust the text file properties to see if you can adjust how the interpreter works by right-mouse the object "netflix_titles.csv" in the data model window and selecting Text file properties from the context menu.
Another option would be to try to use the interpreter Usar el intérprete de datos
It looks like Tableau is reading this file as a Text file and not a CSV. Tableau should have multiple headers for every comma that it sees but your screenshot has a single column for the entire first row.
Sometimes, Tableau can correctly read the file if you check the "Use Data Interpreter" checkbox.
If you have trouble making that work, just simply open the CSV in Excel and save it as an XLSX. You could even connect to it via an import to Google Sheets if you don't have Excel.
I'm wondering which package can be used in a Shiny App to export data to excel file.
I know I can use xlsx, but it requires RJava and I fear that other users can't install it.
you can easily export data to Excel using a download button and base R. Then your file would be a csv-file, which can be easily opened in Excel. An example could be:
https://shiny.rstudio.com/articles/download.html
Would a csv-File be sufficient or do you absolutely need an xlsx-file?
I have to fetch data from Reuters and they provide an excel plugin for that. The problem is that my excel is crashing if I try to fetch too many variables at the same time. I was wondering whether I can do it from R via some excel connection.
In general I want to give the command to excel (from R), fetch data and get the data back in R for analysis. The process has to be repeated a number of times.
=TR("SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/))",A1:K10,"PERIOD:FY2015 NULL:-- curn=USD RH=In CH=Fd",A6)
I get the variable name from (A1:K10) and then the output is stored from cell A6 onwards.
The answer https://stackoverflow.com/a/43222477/1389469 here points to RDCOMClient library but I am not able to run the macro from R as described there.
Another guide here https://cran.r-project.org/web/packages/excel.link/excel.link.pdf talks about how to read/write data from an open excel workbook but doesn't tell how to execute commands in excel from R.