0% found this document useful (0 votes)
13 views15 pages

Intro To Unix-R

Uploaded by

byron7cueva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views15 pages

Intro To Unix-R

Uploaded by

byron7cueva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Please answer the survey before we start!

2024 Edition

Intro to Unix / R / computing


8AM - Monday 4th March

José J. Morosoli
Elizabeth Prom-Wormley
https://forms.office.com/e/ibLW7WNNec

with thanks to Sarah Medland


Welcome!
https://forms.office.com/e/ibLW7WNNec
Getting the most out of the workshop:
► Ask questions!
► Try to sit next to someone you don’t already know.
► Work with someone with different skillset and experience level.
► You will have access to your files after you leave.
► Come to the social functions.
► Do ask questions!!
✓ In person, email, or on the forum. https://isgw-forum.colorado.edu/
https://isgw-forum.colorado.edu
A diverse community!
https://forms.office.com/e/ibLW7WNNec

José J. Morosoli
Diverse skillsets,
backgrounds, research
focus, experience
levels… and timezones!

Be open, be kind, be respectful. We are all learners.


Survey results!
Getting started
► https://workshop.colorado.edu/
Getting started

graphical user interface (GUI)

command-line interface (CLI)


Why Unix? Why?

✓ It allows you to automate tasks.

✓ Replicability: one script, multiple re-runs.

✓ It is more efficient (i.e., fast), scalable and stable than other


systems, not to mention open source (e.g., Windows, MacOS).

✓ Big data (e.g., genetic data) is usually stored and analyzed in


high-performance computing (HPCs) environments, which for
multiple reasons (see above) are based on this language.
Getting started
► Open the first exercise:
https://qualtrics.ucl.ac.uk/jfe/form/SV_0pHnuiW6juZ9ezs
► Open the SSH tab and log in with your username.
Intro to Unix: Glossary
► Graphical User Interface (GUI): platform to interact with a computer that
involves point and clicking and using menus.
► Command Line Interface (CLI): text-based platform where you can
input text commands to interact with a computer.
► Unix: an operative system (just like Windows or MacOS).
► Shell: program where users can type commands.
► Bash: most popular shell in Unix.
► Prompt: symbol that indicates that the shell is waiting for input.
► Command: Pre-defined “words” that tell the system what to do, they can
be modified using options and sometimes require arguments to indicate
what files to operate on, the paths to find them, etc.
Setting up our home directory
/
!
Note:
We need to include “ / ” in the path whenever we
bin data home tmp want to give Unix the full path to the file or
directory we are interacting with or using.

[your-username] ► Files: store information.


► Directories: hold files or other directories.
► File system: part of the operating system
2024 responsible for managing files and directories

Day-1
File 1 File 2 File 3
/home/[user]/2024/Day-1/Unix-R Unix-R
Next stop: R

► Go to the next Qualtrics link:


https://qualtrics.ucl.ac.uk/jfe/form/SV_6FGfSGwaABJQo1E
► Create a R project:
▪ Creates/finds a working directory for you.
▪ Remembers its location.
▪ Makes it easier to resume work after a break.
► Click on IntroToR2024.R to open it.
Directory: ~/2024/Day-1/Unix-R
Similarities between Unix and R

✓Unix and R offer command-line interfaces.


✓Both support scripting for automation.
✓Active communities and extensive package.
✓Open-source.
✓Customizable.
✓Similar commands but not the same!
• E.g., pwd vs getwd()
DeepAI (b. 2016)
Unix r programming languages are friends, 2024
Digital work
Important tabs:
Reminds you of prior code
you used.
Record of objects you have
created.
Text Editor:
Where you write and
save your scripts.

Important tabs:
File explorer.
Graphs you produce.
Packages you have stored.
Help files.

Console: similar to your Unix shell.


Keeps log, you can type commands directly.
Can be cleared using Ctrl+L.
Resources
► Software carpentry: https://software-carpentry.org/lessons/index.html
► https://stackoverflow.com/ and https://unix.stackexchange.com/
► UNIX cheatsheet in /home/josem/2024/Day-1/Unix-R.
► Specific resources for R:
1. R for SAS and SPSS Users:
https://science.nature.nps.gov/im/datamgmt/statistics/R/documents/R_for_SAS_SP
SS_users.pdf
2. An R Style Guide: http://google-styleguide.googlecode.com/svn/trunk/Rguide.xml
3. Rseek: A search engine for all things R related (http://www.rseek.org)
4. R-Bloggers.
5. Quick-R's section on graphics:
http://www.statmethods.net/advgraphs/parameters.html
6. More information on data frames: http://www.r-bloggers.com/exploratory-data-
analysis-useful-r-functions-for-exploring-a-data-frame.
7. Details on how to develop your own package: http://r-pkgs.had.co.nz
R Code – Best practices

https://www.r-bloggers.com/2018/09/r-code-best-practices/
https://www.library.ucsb.edu/sites/default/files/dls-n01-2021-filenaming.pdf

You might also like