R: Error: unexpected numeric constant (in names of columns)
<p>I have an error that I don't understand.</p>

<p>I have downloaded an Excel file with unemploymente rates by country and by year.
Basically, column 1 is Country, column 2 is 1990, column 3 etc...</p>

<p>I am trying to plot an histogram unemployment rate in 2005.
I use this code:</p>

<pre><code>qplot(x=2005,y=Country,data=data)
</code></pre>

<p>But I always have this error:</p>

<pre><code>Error: unexpected numeric constant in
</code></pre>

<p>I have tried to:
- convert all the names in character
- add a "y" before the year
- put brackets</p>

<p>But I still have this error.</p>

<pre><code>Error: unexpected numeric constant in "qplot(y=data$2005"
Error: unexpected numeric constant in "qplot(x=y 2005"
</code></pre>

<p>With brackets, I have this error</p>

<pre><code>Error: unexpected '[' in "qplot(x=["
</code></pre>

<p>Any idea? Many thanks in advance!</p>

<p>Edit:
Dataset:[link]<a href="https://docs.google.com/spreadsheets/d/1frieoKODnD9sX3VCZy5c3QAjBXMY-vN7k_I9gR-gcU8/pub?gid=0[link]" rel="nofollow">https://docs.google.com/spreadsheets/d/1frieoKODnD9sX3VCZy5c3QAjBXMY-vN7k_I9gR-gcU8/pub?gid=0[link]</a></p>

<p>I have downloaded it (xlxs format), and changed the name of the first column</p>

<pre><code>library(ggplot2)
library(readxl)
file&lt;-"indicator_t 15-24 unemploy.xlsx"
excel_sheets(file)
data&lt;-read_excel(file)
</code></pre>

<p>I've tried to plot:</p>

<pre><code>qplot(x=2005,y=Total 15-24 unemployment (%),data=data)

Error: unexpected numeric constant in "qplot(x=2005,y=Total 15"
</code></pre>

<p>I have changed the named of the first column, and added a "y" before the years.</p>

<pre><code>names2&lt;-paste("y",names(data[,2:length(data)]))
data2&lt;-c("Country",names2)
colnames(data)&lt;-data2
</code></pre>

<p>I still have an error:</p>

<pre><code>qplot(x=y2005,y=Country,data=data)

Error in eval(expr, envir, enclos) : object 'y2005' not found
</code></pre>