June 8, 2017

UK R Courses

Filed under: R, Teaching — Tags: — csgillespie @ 8:30 am

Over the next few months we’re running a number of R, Stan and Scala courses¬†around the UK.

June (London)
  • Mon Jun 26 – Introduction to R
  • Tue Jun 27 – Statistical Modelling with R
  • Wed Jun 28 – Programming with R
  • Thu Jun 29 (2-day course) – Advanced R Programming
August (Belfast)
  • Thu Aug 10 – Programming with R
  • Fri Aug 11 – Building an R Package
September 2017 (Newcastle)
  • Mon Sep 11 – Introduction to R
  • Tue Sep 12- Statistical Modelling with R
  • Wed Sep 13- Programming with R
  • Thu Sep 14- Advanced Graphics with R
  • Fri Sep 15- Automated Reporting (first steps towards Shiny)
  • Mon Sep 18 (5-day course) – Bioconductor
October (Glasgow)
  • Wed Oct 25 – Advanced Graphics with R
  • Thu Oct 26 (2-day course) – Advanced R Programming
November (London)
  • Mon Nov 06 (1-day course) – Efficient R Programming
  • Tue Nov 07 (1-day course) – R for Big Data
December (London/Newcastle)
  • Thu Dec 07 (2-day course) – Introduction to Bayesian Inference using RStan (Newcastle)
  • Mon Dec 11 (3-day course) – Scala for Statistical Computing and Data Science (London)

See the website for course descriptions. Any questions, feel free to contact me: colin@jumpingrivers.com

On site courses available on request.

June 7, 2017

Security: the dangers of copying and pasting R code

Filed under: Computing, R — Tags: — csgillespie @ 10:11 am

Most of the time when we stumble across a code snippet online, we often blindly copy and paste it into the R console. I suspect almost everyone does this. After all, what’s the harm? Consider this simple piece of R code that performs simple linear regression

# Generate data
x = rnorm(10)
y = rnorm(10)
message(“All your base are belong to us.”)
# Simple linear regression 
m = lm(y ~ x)

Now highlight the above piece of R code and copy and paste it into your console; look carefully at what you’ve pasted. A new line has magically appeared.

# Generate data
x = rnorm(10)
y = rnorm(10)
message("All your base are belong to us.")
# Simple linear regression
m = lm(y ~ x)

Due to some sneaky CSS magic, I was able to hide the message() statement. If I was evil, I could have changed this to a system, source, or any other command.

The CSS code simply sets the message() function to the background color, changes the font size and makes it un-selectable (see this post for details).

So remember, be careful with your copy and pasting!

Create a free website or blog at WordPress.com.