Skip to content
Prev 295195 / 398506 Next

system() under windows [x] but not with Mac

The Mac does not have an application called notepad, so you can't "save a
text in [your] notepad". However, the Mac has TextEdit, and if you save
any file with the ".txt" suffix it will open in TextEdit when you
double-click on it in a Finder window (outside R, that is).

You could even, from inside R, type
  system('open name.txt')
and it will open the file in TextEdit, provided that the file is in what R
considers to be your working directory.

To save a file from within R, start by viewing the help pages for
  write.table
  sink
  cat
depending on what you want to save and how you want it structured in the
file.

-Don