# Regression with .csv tables

I am having trouble getting regression to work. If you wouldn't mind just looking over the code and point me in the right direction I'd really appreciate it. I have loaded pgfplots and pgfplotstable packages.I am new to asking questions here, I apologise if I have made any errors in etiquette.

\begin{figure}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
axis lines=left,
width=\linewidth, % Scale the plot to \linewidth
xlabel=$\omega ^-1$, % Set the labels
ylabel=Limiting Current,
x unit=\si{\radian\per\second}\$^-\frac{1}{2}, % Set the respective units
y unit=\si{\ampere},
%xmin=-1100,
%ymin=-0.00004,
legend style={at={(1,0.7)},anchor=north east}
]
table {Data/nRDE400.csv};
table[y={create col/linear regression={y=column 2}},col sep=comma] {Data/nRDE400.csv};
\end{axis}
\end{tikzpicture}
\caption{RDE studies of modified electrode in 0.5 M NaOH saturated with \ce{O2} and scan rate of 20 \si{\milli\volt\per\second}.}
\label{RDESCANS2}
\end{center}
\end{figure}


My .csv file looks like this:

column 1,column 2
0.1545,6.4721
0.1093,9.1529
0.0892,11.2100
0.0773,12.9442
0.0691,14.4720
0.0631,15.8533

• Hi Charles, welcome to the site! In general, it's preferred to include a minimal working example instead of code snippets, i.e. a complete document (starting with \documentclass) that can be compiled without changes and that includes only the minimum code necessary to demonstrate the problem. The code I included in my answer is an example of how such a document could look in your case. – Jake Jul 21 '15 at 15:44
• Hi Jake, thank you for the welcome. I am very excited to contribute and improve my LateX with the help of the people here. I understand what mean completely. I will be sure to post questions in the manner you have said from now on. – Charles O'Donoghue Jul 22 '15 at 7:39

The col sep key needs to go in the table [...] options, not the \addplot [...] options:

\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable}

\begin{document}
\begin{tikzpicture}
\begin{axis}