Skip to posts

Statistical Machine Learning and Visualization

At the Georgia Institute of Technology
  • Home
  • People
  • News
  • Seminar
  • Projects
  • Software
  • ML/CDA
  • DAVA
  • Workspace
  • Archive
  • Links
  • Internal

Recent Posts

  • New Book on Probability with R
  • CDA Discussion Board (Fall 2011)
  • Majorization Minimization: A Simple Recipe for Cute Optimization
  • X Seen by Y
  • Public courses at Stanford

Events

Meta

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Programming in R: Discussion Board, Spring 2011

January 20, 2011 glebanon 12 comments
Uncategorized DAVA, Programming
  • Comments (12)
Leave a comment
  • avatar
    #1 | Written by glebanon about 2 years ago.

    please post more questions and comments. Example of syntax highlighting:

    help('sink'); # can be used to record output to a file. Use split=TRUE to display output on screen as well
  • avatar
    #2 | Written by gtg609h about 2 years ago.

    I learned how to use R about a year ago for some research.

    Here are some useful pointers:

    1) If you are looking for a nice IDE for R, try out StatET. It is a plugin for eclipse.
    http://www.eclipse.org/
    http://www.walware.de/goto/statet

    2) If you are looking for a good book to learn R, try R in a Nutshell.

    http://www.amazon.com/R-Nutshell-Desktop-Quick-Reference/dp/059680170X/

    A lot of learn how to use R books are for people new to programming. This book assumes you know how to program and really goes into specifics.

    3) If you are looking for some good R coding conventions, see http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html.

  • avatar
    #3 | Written by tgallagher about 2 years ago.

    In a comment on the other thread, I posted a website for color maps, particularly colorblind-safe color maps. This is important for ggplot2 because the color maps can be changed to any of the ones listed on the website Color Brewer.

    For example:

    qplot(...)
    last_plot() + scale_color_brewer('Name of color map from website')

    This will generate the plot and then change the color map and regenerate the plot. If you don’t want to do the first rendering (since you are changing the color map anyway), you can do:

    myPlot <- qplot(...)
    myPlot + scale_color_brewer(...)

    and the figure will render on the second command.

  • avatar
    #4 | Written by mightybean about 2 years ago.

    how does one go about creating multiple figures (not multiple plots on one figure)?

    trying to have multiple plots appear separately or in addition to and not overwrite pre-existing plot. kind of like using “figure()” in matlab to create a new figure space.

  • avatar
    #5 | Written by glebanon about 2 years ago.

    You have to create multiple graphics devices. A graphics device can be a figure on the screen (x11() or linux, quartz() on mac etc) or a file device like pdf() or png() which saves the figure to a file in that format. To create multiple devices see http://cran.r-project.org/doc/manuals/R-intro.html#Multiple-graphics-devices for an explanation. For example in linux you would have multiple calls to x11() function to create multiple screen drivers and then alternate between them (see the above link). Also, note the function ggsave that let’s you easily save ggplot2 figures to disk as pdf/ps/png.

  • avatar
    #6 | Written by mightybean about 2 years ago.

    there are packages that exist that one (i, myself) can’t seem to install simply by install.packages(“rgdal”) but instead download it from CRAN.r directly? so i went and did that and then tried to install by any/all below commands:

    > install.packages(“rgdal”, lib.loc=”/my/own/R-packages/”)
    > install.packages(“rgdal”,lib=”/my/own/R-packages/”)
    > install.packages(“rgdal”)

    i get the error that ‘rgdal’ is not available. i’ve been trying to read this for help:

    http://cran.r-project.org/doc/manuals/R-admin.html#Add_002don-packages

    (which does not appear to be composed by anyone who has ever sought help from a manual)

  • avatar
    #7 | Written by glebanon about 2 years ago.

    Are you using windows? Sec 6.3.1 at the link that you cite bove talk about windows specific compilation problems. In any case I don’t know much more about this so I can’t help here.

  • avatar
    #8 | Written by Bharathi about 2 years ago.

    Which version of R are you using? some packages are version dependent.

  • avatar
    #9 | Written by titanc21st about 2 years ago.

    It is nice information in this blog about I posted a website for color maps, color blindness color chart particular security. This is important because ggplot2 color maps can be changed at all those listed on the site

    . I recommend to other for joining here to know more about this site.
    Dinares iraqui

  • avatar
    #10 | Written by monosij about 2 years ago.

    Thought this article by Robert Gentleman was interesting…
    http://www.r-bloggers.com/%E2%80%9Csimply-start-over-and-build-something-better%E2%80%9D/

  • avatar
    #11 | Written by monosij about 2 years ago.

    Question on sampling the data – the sampling below with replace either TRUE or FALSE always return me the same data:

    sample(nrow(movies), size=10, replace=TRUE)

    sample(nrow(movies), size=10, replace=FALSE)

    They return different sets of indexes but the same sets always.
    I first noticed it when I was looking at a small set of indexes but then I tried with a larger set of indexes and still the same.

    Any suggestions would be appreciated.

    Thanks.

  • avatar
    #12 | Written by glebanon about 2 years ago.

    that’s probably because nrow(movies) is much larger than size and there is very little probability in this case of seeing a difference. You will see a difference for example in

    sample(10,10)  # permutation of 1,..,10
    sample(10,10,replace=TRUE)  # most likely you will see some repeating values

Leave a Comment

Cancel Reply

You must be logged in to post a comment.

Previous Post Next Post
Avatars by Sterling Adventures
Powered by WordPress Web Design by SRS Solutions © 2013 Statistical Machine Learning and Visualization Design by SRS Solutions