I have been given a minitab worksheet file (.mtw), and I would like to open it in R.
Unfortunately, I only know of R's foreign package to open other filetypes, which only includes minitab's portable files (.mtp). Is there a way to open .mtw files, and if not how would I go about converting the file to .mtp?
If you want to convert your mtw worksheet to mtp extension, simply open the mtw file on minitab and from File menu select "Save Current Worksheet As" and save it to mtp extension. It will save it as Text not Encrypted
You would be able then to use foreign
Related
I'm trying to open an Excel CSV file within R Studio but I get this error:
Error Is this a valid CSV file? embedded nul in the string: 'C\0a\0m\0p\0a\0g\0n\0e\0_\0N\0o\0C\0a\0r\0a\0v\0a\0g\0g\0i\0o\0_\0C\0o\0s\0t\0o\0>\00'
the file is generated automatically by the Google Ads platform as Excel csv and it works normally with Excel but in order to open it on R Studio I have to convert it as .xlsx
is there a way to bypass this or to convert the file without opening it?
otherwise the script which is based upon this file needs a manual passage to convert the source file
What function are you using to open it? Check your file and see if you have other commas within a column value; this may confuse the function. Also, it is worth trying to use the "Import dataset" option in the environment window within Rstudio. Try to use the readr option and adjust your import options until you have it correct. Check the package RAdwords maybe you can extract your Google Ads information without the CSV exporting step.
I have an excel file that queries Olap cube using DAX.
For some unfortunate reasons with DBAs, this is currently only viable way for me to load cube data into R.
So I am trying to automatize opening, refreshing, and closing excel file using R script, instead of doing that manually.
After some web search, I am able to open the excel file using Shell(). And the excel file is set to refresh itself when it is opened.
What come's next is where I need help; I want to save this file (like Ctrl + S) and close it. So I can load it to my R.
#open excel file
shell.exec("zero_billed_cases.xlsx")
#save excel file
"How do I do this?"
#close excel file (this is what I found online, but this only opens the file)
shell('\"zero_billed_cases.xlsx\"')
Thanks for your time and effort!
Is there something in R to open a text file? In Python, one could open a text file using notepad:
import subprocess as sp
programName = "notepad.exe"
fileName = "file.txt"
sp.Popen([programName, fileName])
Other methods are described in the post as well. Is there something similar in R?
Keeping in mind portability issues, i.e. this is specific to Windows, you can use shell.exec, which will open the file in whatever program is associated with that type of file by default - e.g.
## full path
shell.exec(paste0(c(getwd(), "/tmpfile.txt"),collapse = ""))
## relative to current working directory
shell.exec("tmpfile.txt")
both open tmpfile.txt in notepad on my machine.
Plain and simple: is there a way to read (not run) .sas files on osx in order to rewrite old SAS programs in another language, e.g. R? Note I do not refer to reading sas data files – I know there are several ways, I am just interested in reading old SAS code.
.sas files containing SAS code should just be a text file. You can use any text editor that you like to open and modify these files. Since the system probably doesn't have .sas files associated with any particular program you can either use the "Open with" option when "right-clicking" on the file or you could open the editor first and then open the file from within the editor.
TextEdit will work. Another editor that I like is Komodo Edit.
I have a Flex application with a couple of DataGrids with data. I'd like to save the data to a file so that the user can keep working with them in Excel, OpenOffice or Numbers.
I'm currently writing a csv file straight off, which opens well in OpenOffice or Numbers, but not in Excel. The problem is with the Swedish characters ÅÄÖ, which turn up as other characters when opening in Excel. Converting (in Notepad++) the csv-file to ANSI encoding makes the ÅÄÖ show up correctly in Excel.
Is there any way to write ANSI-encoded files straight from Flex?
Any other options for writing a file that can be opened in Excel and OpenOffice?
(I've looked at the as3xls library, but according to the comments those files cannot be opened in OpenOffice)
Using the writeMultiByte function from the ByteArray class allows you to specify a character set. See :
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html#writeMultiByte%28%29
There is also the option of the as3xls package at http://code.google.com/p/as3xls/. I like this as it comes out as a straight excel file that can also be easily opened in open office as well.