Psychophysics with R: A short tutorial

In the following pages we show the basic R syntax for:

If you are not familiar with R or you want to have a closer look in a given topic, we suggest you reading the related Manual in the CRAN/Manuals web page. See also our links page in for further reading. If you have specific questions about a function, you can access the related help page by typing ?name of the function or help(“name of the function). For example,  ?plot or help(“plot”).

To use the codes that you find in my blog:

  • Open R. Open a new script
  • Copy the code from the website on the dashboard (command on the upper right corner).
  • Past on the script and save it with a name, use the .r  extension (i.e. mycodename.r). Modify if necessary the path and file names.
  • In R Console, type:
source("mypath/mycodename.r")

Or simply download MERpsychophysics from the blogroll – most of the R-commands are already there! If you use the MERpsychophycs code or you would like to acknowledge this tutorial, please cite our article:

Moscatelli A, Mezzetti M, Lacquaniti F (2012). Modelling Psychophysical Data at the Population-Level: The Generalized Linear Mixed Model. Journal of Vision, 12(11):26, 1-17.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s