[R] RMySQL and '_' character in column names

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Oct 30 20:42:56 CET 2003


?make.names may help.

On Thu, 30 Oct 2003, Xavier Fernández i Marín wrote:

> Hi,
> 
> I'm using RMySQL in order to obtain data from my MySQL server. In my databases 
> sometimes I have columns with names that contain '_' character (ex: 
> 'gdp_capita', 'population_total', etc...). When these names appear as the 
> names of the vectors in the data frame that I get, sometimes I have problems 
> as:
> 
> > cor(gdp_capita, population_total)
> Error: object "_capita" not found
> use of _ is soon to be removed.
> 
> Is there an automatic way to transform the '_' characters in MySQL to '.' in R 
> using RMysql?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list