mala::home Davide “+mala” Eynard’s website


Statistical learning with R part 1 (2016): Linear regression

[This post is part of the Statistical learning with R - 2016 edition series. You might want to check out the 2015 edition too]

So, if you are here you probably have already unpacked the zip file. If not, please check this page before starting.

Try to run LinearRegressionDemo.R: supposing your current working directory is the one where you unpacked the R files, type


The print.eval parameter is needed to show you the output of some commands such as summary in the context of the source command.

Run the demo and try answering the questions you find there. In some cases you should be able to do that immediately after looking at the results, in others you will first need to add few lines of code to actually get any result. If you find yourself stuck anywhere, all the material you should need is either in the script itself or in the lab notes.

Comments (2) Trackbacks (0)
  1. Hi , i’ve a problem in opening the dataset.
    This is what happens : when it executes the following :

    data = read.table(“”,header = TRUE)

    R prints out :
    Error in file(file, “rt”) : cannot open the connection
    In addition: Warning message:
    In file(file, “rt”) :
    cannot open file ‘’: No such file or directory

    Is it due simply to the fact that the ‘’ file is missing on the package i downloaded (it simply contains the file with the source code ) or is it something more ??

    Have a nice day
    Luca carloni

Leave a comment

No trackbacks yet.