University Logo

Welcome

Welcome to Lancaster University’s Department of Psychology 2023/2024 modules on Statistics for Psychologists. In the sidebar, you will find a complete list of all the statistics modules that are currently offered on this webpage. This is your one-stop shop for all the materials you need for working with R and statistics.

Accessing the R Server

To log in to the R server, first make sure that you have the VPN switched on, or you will need to be connected to the university network (Eduroam). To set up the VPN, follow ISS instructions here or connecting to Eduroam here.

When you are connected, navigate to https://psy-rstudio.lancaster.ac.uk, where you will be shown a login screen that looks like the below. Click the option that says “Sign in with SAML”.

This will take you through to the University login screen, where you should enter your username (e.g. ivorym) and then your university password. This will then redirect you to the R server where you can start using RStudio!

Note

If you have already logged in through the university login already, perhaps to get to the portal, then you may not see the username/password screen. When you click login, you will be redirected straight to RStudio. This is because the server shares the login information securely across the university.

FAQs and Common Troubleshooting

If your web browser is constantly loading and timing out and never showing you the login for the R server, then it’s likely the issue is with the web connection. You need to make sure that you are either connecting to Lancaster’s Eduroam: https://portal.lancaster.ac.uk/ask/connect-eduroam/ or if you are off-campus, that you are connected to the VPN: https://portal.lancaster.ac.uk/ask/vpn/
If you are still having problems, it may be that the server is down, and you can check your others on the course to see if they have the same problems. If others are experiencing issues, get in touch with your module coordinator to get this looked at.

Welcome to statistical programming. Try and carefully read the error codes to understand what the problem may be. You might be surprised to find out that the internet is an amazing resource for fixing your errors. Once you’ve checked it isn’t a typo, you can often copy-paste the error message into Google to see if others are having similar issues. Trusted resources include Stackoverflow, r-bloggers. The important thing is not to be afraid of errors, they’re trying to be helpful!

Hopefully not, but maybe. If it is, then the error is likely a "connection refused" and may even say something about the server maybe being down. If this is the case, either wait a little while to see if we’re in the middle of booting it back up, or get in touch with your module coordinator to pass the message on to the R team.

Yes!
You can also install R and Rstudio onto your own computer which has its advantages and disadvantages to using the R server. You can install R and Rstudio directly from Posit (https://posit.co/download/rstudio-desktop/), who develop and maintain Rstudio. You will need to install both, R is the programming language and Rstudio is the interface between you and the computer that runs R. The advantage of having your own installation of R and Rstudio (just referred to as Rstudio from here on in) is that *you* control the settings completely.
You can install new packages, set defaults, use specific versions of R and its libraries. In short, you have complete control over what you can do, which will lead to you becoming a better, more well-rounded data scientist (when we use R, we are data scientists as well as psychologists. You can wear many hats of expertise!). The disadvantage is that *you* are in control. If something goes wrong or doesn't install properly, it is up to you to resolve. As a department, we strongly recommend that you use the R server as your means of accessing Rstudio as we know that the server works, we have tested the teaching materials with the server and in labs we can help troubleshoot because we know that the version of R, the libraries, etc. are handled by us, we look after it so that you don't have to. A multitude of things can go wrong with a personal installation and you will need to fix this (which is part of being a well-rounded data scientist). If you ask for help with a local install, the first thing we will ask is "does it work on the R server?", if the answer is yes, then we can give some pointers but we cannot fix it for you (in my personal experience, I once spent 8+ hours of actively trying to fix a single issue with my Rstudio \[okay, so it was quite complex an issue, but the point remains\]). As you see, the advantage and disadvantage are intrinsically linked.
From a teaching perspective, we cannot try and problem solve every person's individual and unique setup of Rstudio, there simply isn't enough time in a week. Yet the benefit of having your own version means you are totally unrestricted in what you can do with R, if you can imagine it, there is probably a set of libraries and functions that can help. If there isn't, you can make them! It is your choice for how to use Rstudio, but we recommend that you use the R server for the materials that we teach, but we provide this to complement and enhance the teaching experience. If you want to go beyond what is in the worksheets, then installing and using your own version of Rstudio is a very good first step

Great question. We can recommend looking at these books, R for Data Science, Advanced R, etc., as well as websites like StackOverflow, r-bloggers. Quite often, googling terms like "r linear regression" or "r residuals for regression" will help you find someone who has a tutorial and code to look at. Don’t be afraid to explore and adapt other people’s examples to work for you.
Back to top