'Linear regression from scatter Plot in Julia

I want to use Linear regression to approximate a scatter plot in Julia. I used this code as an example:

v1 = readdlm("TestFile.txt"; skipstart=2);

scatter(v1[:, 1], v1[:, 2], ms=1, legend=nothing)

enter image description here

The problem is that I am using data from a .txt file. I am not sure how I should tackle my code in order for linear regression to work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source