david.whiting@ncl.ac.uk
2005-Feb-24 18:38 UTC
[Rd] sqlSave reports invalid regular expression '[^[:alnum]_]+' (PR#7703)
Full_Name: David Whiting Version: 2.1.0 Under development (unstable) OS: linux Submission from: (NULL) (82.39.106.169) I have just upgraded from a previous version (2.0.0?) and found some of my code that used okay to run now gives an error. The function being called is sqlSave(). I am pretty sure (but not 100% certain) that the data frame I am trying to save has not changed. I am 100% sure that the ODBC connection information for MySQL has not changed and I have not updated MySQL.> sqlSave(lh, data, "survey")Error in gsub(pattern, replacement, x, ignore.case, extended, fixed) : invalid regular expression '[^[:alnum]_]+'> traceback()4: gsub("[^[:alnum]_]+", "", colnames) 3: mangleColNames(names(colspecs)) 2: sqltablecreate(tablename, colspecs = colspecs, keys = keys) 1: sqlSave(lh, data, "survey")> str(data)`data.frame': 192 obs. of 171 variables: [...] (I can send the whole structure if that will help)> version_ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status Under development (unstable) major 2 minor 1.0 year 2005 month 02 day 24 language R>
Tony Plate
2005-Feb-24 18:57 UTC
[Rd] sqlSave reports invalid regular expression '[^[:alnum]_]+' (PR#7703)
I suspect that the error message is now correct, AFAIK, the correct syntax
for that regular expression is '[^[:alnum:]_]' (your version is missing
the
second colon). Looks like the previous version of R did just not give you
a error message that the regular expression was invalid (and you might want
to consider what it was doing with that expression -- probably not what was
intended.)
Apparently this regular expression is defined in the function
mangleColNames() in the package RODBC. When I look at RODBC I see a
correct regular expression in mangleColNames() -- have you perhaps an old
or corrupt version of the RODBC package?
> getAnywhere("mangleColNames")
A single object matching 'mangleColNames' was found
It was found in the following places
namespace:RODBC
with value
function (colnames)
gsub("[^[:alnum:]_]+", "", colnames)
<environment: namespace:RODBC>
>
My copy of RODBC has the following info:
Information on Package 'RODBC'
Description:
Package: RODBC
Version: 1.1-3
Date: 2005-02-05
Author: Originally Michael Lapsley
<mlapsley@sthelier.sghms.ac.uk>, since Oct 2002
B. D. Ripley <ripley@stats.ox.ac.uk>
Maintainer: B. D. Ripley <ripley@stats.ox.ac.uk>
Title: ODBC database access
Description: An ODBC database interface
SystemRequirements: An ODBC driver manager and drivers. See README.
Depends: R (>= 1.9.0)
License: GPL2
Packaged: Mon Feb 7 08:32:20 2005; ripley
Built: R 2.0.1; i386-pc-mingw32; 2005-02-08 12:21:23;
windows
-- Tony Plate
At Thursday 10:37 AM 2/24/2005, david.whiting@ncl.ac.uk
wrote:>Full_Name: David Whiting
>Version: 2.1.0 Under development (unstable)
>OS: linux
>Submission from: (NULL) (82.39.106.169)
>
>
>I have just upgraded from a previous version (2.0.0?) and found some of my
>code
>that used okay to run now gives an error. The function being called is
>sqlSave(). I am pretty sure (but not 100% certain) that the data frame I am
>trying to save has not changed. I am 100% sure that the ODBC connection
>information for MySQL has not changed and I have not updated MySQL.
>
> > sqlSave(lh, data, "survey")
>Error in gsub(pattern, replacement, x, ignore.case, extended, fixed) :
> invalid regular expression '[^[:alnum]_]+'
> > traceback()
>4: gsub("[^[:alnum]_]+", "", colnames)
>3: mangleColNames(names(colspecs))
>2: sqltablecreate(tablename, colspecs = colspecs, keys = keys)
>1: sqlSave(lh, data, "survey")
>
> > str(data)
>`data.frame': 192 obs. of 171 variables:
>[...]
>(I can send the whole structure if that will help)
>
> > version
> _
>platform i686-pc-linux-gnu
>arch i686
>os linux-gnu
>system i686, linux-gnu
>status Under development (unstable)
>major 2
>minor 1.0
>year 2005
>month 02
>day 24
>language R
> >
>
>______________________________________________
>R-devel@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-devel
Prof Brian Ripley
2005-Feb-24 19:07 UTC
[Rd] sqlSave reports invalid regular expression '[^[:alnum]_]+' (PR#7703)
Do not use R-bugs for reports on compatibility of obselete versiond of packages with unreleased versions of R! You did not give the RODBC version no. The current version, 1.1-3, is compatible with R-devel. 1.1-2 was not (alongside a dozen or so CRAN packages). The only bugs here are in the report. On Thu, 24 Feb 2005 david.whiting@ncl.ac.uk wrote:> Full_Name: David Whiting > Version: 2.1.0 Under development (unstable) > OS: linux > Submission from: (NULL) (82.39.106.169) > > > I have just upgraded from a previous version (2.0.0?) and found some of my code > that used okay to run now gives an error. The function being called is > sqlSave(). I am pretty sure (but not 100% certain) that the data frame I am > trying to save has not changed. I am 100% sure that the ODBC connection > information for MySQL has not changed and I have not updated MySQL. > >> sqlSave(lh, data, "survey") > Error in gsub(pattern, replacement, x, ignore.case, extended, fixed) : > invalid regular expression '[^[:alnum]_]+' >> traceback() > 4: gsub("[^[:alnum]_]+", "", colnames) > 3: mangleColNames(names(colspecs)) > 2: sqltablecreate(tablename, colspecs = colspecs, keys = keys) > 1: sqlSave(lh, data, "survey") > >> str(data) > `data.frame': 192 obs. of 171 variables: > [...] > (I can send the whole structure if that will help) > >> version > _ > platform i686-pc-linux-gnu > arch i686 > os linux-gnu > system i686, linux-gnu > status Under development (unstable) > major 2 > minor 1.0 > year 2005 > month 02 > day 24 > language R >> > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley@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