1 June 2016

Today's agenda

  • What problems are you facing? What would you like to do?
  • How to become an expert in scientific computing
  • How far did you get on Terminus?
  • Some important commands
  • Reading in data files and making simple plots in R

What problems are you facing? What would you like to do?

I've talked to your mentors to find out what computing skills you might need to learn for your projects. Here are some things they mentioned:

  • Reading in data from files
  • Making plots and figures

What would you like to be able to do that isn't on this list?

Have you encountered any problems in your use of computers here at Penn State?

How to become an expert in scientific computing

Practice, practice, practice! But seriously,

  • Pick a project (start small)
  • Pick a programming language that's appropriate for your project (ask for help here!)
  • Search the Internet (how have other people done this type of project before?)
  • Try to solve the problem (you'll make lots of mistakes)
  • Get stuck (this happens a lot)
  • Look for help (search the Internet, ask local experts)
  • Finish your project (get feedback and learn from it)
  • Repeat many times

How far did you get on Terminus?

Did anyone reach Paradise?

Where did you get stuck?

Some important commands

Command What it does
ls LiSt the files and folders in a directory
cd Change Directory
pwd Present Working Directory
mkdir MaKe DIRectory
rm ReMove files and folders (careful – there's no undo!)
cp CoPy files from one place to another
mv MoVe files from one place to another
more Look at the contents of text files (less doesn't work on SCRiM systems)

Experimenting with these commands

  • Open Chrome
  • Install the VNC app
  • Log in to woju from VNC (woju.scrim.psu.edu:5999)
  • In the menu bar at the top, click Places > Home Folder
  • Also in the menu bar, click Applications > System Tools > Terminal
  • Put the two windows next to each other

Try the following commands in the Terminal and see what happens

ls
nano scrim_text
more scrim_text
mkdir scrim_folder
ls
mv scrim_text scrim_folder/
cd scrim_folder
ls
cd ..
rm -rf scrim_folder
ls

What questions do you have so far?

Doing scientific computing in R

If you get stuck or bored and want to learn a lot about R

Using R on SCRiM computers

Reading in data in R

Some key commands:

  • download.file
  • read.table or read.csv

A simple example

Have a look at http://cdiac.ornl.gov/trends/co2/sio-mlo.html

We can download and plot the data from this page with the following commands:

download.file("http://cdiac.ornl.gov/ftp/trends/co2/maunaloa.co2", 
              "mauna_loa_co2.txt")

data <- read.table("mauna_loa_co2.txt", header = TRUE, 
                   row.names = NULL, skip = 14, nrows = 51, 
                   na.strings = "-99.99")

plot(data[, 1], data[, 13], xlab = "Year", 
     ylab = "Carbon dioxide concentration [ppmv]", 
     main = "Mauna Loa")

If we have extra time