Script for solution of CSC 120, Spring 2015, Assignment 1.

``````> source("http://www.cs.utoronto.ca/~radford/csc120/a1funs.r")
``````

Read and display the small data set of five web sites. Save the data in the variable slink_data.

``````> slink_data <- read_links(5,"http://www.cs.utoronto.ca/~radford/csc120/slink")
``````
``````[[1]]
[1] 2 4

[[2]]
[1] 1 4 3

[[3]]
[1] 1

[[4]]
[1] 1 3 2

[[5]]
[1] 2 4
``````

Plot the links in the small data set with all links shown.

``````> show_data(slink_data)
``````

Plot the links in the small data set excluding links out of sites with more than two outward links.

``````> show_data(slink_data, 2)
``````

Test the error check on the data by trying to read data on just the first three web sites for the small data set. This should produce an error, since there are references to web site 4 in the files for the first three web sites.

``````> slink_data <- read_links(3,"http://www.cs.utoronto.ca/~radford/csc120/slink")
``````
``````Error in read_links(3, "http://www.cs.utoronto.ca/~radford/csc120/slink"): Invalid link
``````

Read the big data set, storing the data in the variable blink_data.

``````> blink_data <- read_links(35,"http://www.cs.utoronto.ca/~radford/csc120/blink")
``````

Plot the links in the big data set with all links shown.

``````> show_data(blink_data)
``````

Plot the links in the big data set excluding links out of sites with more than ten outward links.

``````> show_data(blink_data, 10)
``````

All done!