An archived instance of Mark's Discourse site as of Tuesday July 18, 2017.

MAC Users: Send Help!

Kristian

Hey guys, I am trying to adjust my data on "Playing with some random data." Nonetheless, I have a macbook and I can't figure out how to get my charts created in R from the computer to the input part on that forum. I tried clicking with two fingers, to "right click," like I did on the PC in class originally to get it there, but it wasn't giving me the option to do anything. I also tried to save it on my computer and drag and drop, but that wasn't working either. Anyone have any suggestions?? THANKS! :wink:

mark

@Kristian There are actually quite a few R interfaces so it depends, even if you specify which one you're working with. One thing that always works is to type the following at the R command line:

png('mypic.png')
hist(subset(my_data, sex=='male')$height)
dev.off()
  • The first line sets things up for writing the file
  • The second line generates the image (it won't appear as usual and, of course, you should enter whatever command is relevant here)
  • The final line wraps things up and writes the file

The file 'mypic.png' should then automagically appear in your working directory. If you're not sure what directory you're working in, you can execute getwd() to find out or setwd() to set it.


Alternatively, there's a good chance you're working with RStudio. Here's a screen shot indicating where the export image menu is on my Mac: