Dear all, I successfully set up a local MySQL-database. Connecting via RODBC is not problem, the same in fetching 3 of 4 tables. But trying to connect to table 4 fails.> author<-sqlFetch(test,"author")Error in fromchar(unclass(x)) : character string is not in a standard unambiguous format In principle I understand that error message, but I don't know any solution. Thanks for any help, Bernd> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Under development (unstable) major 2 minor 3.0 year 2005 month 10 day 06 svn rev 35759 language R
Hi, there is a problem with the type of attributes - is it varchar!? IMHO you should play a bit with different type's in mysql and the consequence in R. I recognize "similar" problems with RMySQL, if you have variables with type decimal in mysql you get numerics in chr. But it's possible to change the decimal in double (mysql) to get num in R. regards, Christian>Dear all, > >I successfully set up a local MySQL-database. Connecting via RODBC is >not problem, the same in fetching 3 of 4 tables. But trying to >connect to table 4 fails. > > > >>author<-sqlFetch(test,"author") >> >> >Error in fromchar(unclass(x)) : character string is not in a standard >unambiguous format > >In principle I understand that error message, but I don't know any >solution. > >Thanks for any help, > >Bernd > > > > >>version >> >> > _ >platform i386-pc-mingw32 >arch i386 >os mingw32 >system i386, mingw32 >status Under development (unstable) >major 2 >minor 3.0 >year 2005 >month 10 >day 06 >svn rev 35759 >language R > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > >
On Mon, 10 Oct 2005, Bernd Weiss wrote:> I successfully set up a local MySQL-database. Connecting via RODBC is > not problem, the same in fetching 3 of 4 tables. But trying to > connect to table 4 fails. > >> author<-sqlFetch(test,"author") > Error in fromchar(unclass(x)) : character string is not in a standard > unambiguous formatTry traceback() after an error that is lacking context: it would have helped.> In principle I understand that error message, but I don't know any > solution.You have a date or datetime or timestamp column that is not in a format R recognizes. Use argument 'as.is' to bring it across as character. See ?sqlGetResults (referenced from ?sqlFetch). -- 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
Am 10 Oct 2005 um 7:51 hat christian schulz geschrieben:> Hi, > > there is a problem with the type of attributes - is it varchar!? IMHO > you should play a bit with different type's in mysql and the > consequence in R. > > I recognize "similar" problems with RMySQL, if you have variables > with type decimal in mysql you get numerics in chr. But it's possible > to change the decimal in double (mysql) to get num in R.Thanks to Christian Schulz and Prof. Ripley for their valuable suggestions. The use of author<-sqlFetch(test,"author",as.is=17) does the job without any problems. Bernd