RE: [R] Searching for a string in RSQLite

2004-11-25 Thread Dr Mike Waters
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Duncan Murdoch
 Sent: 25 November 2004 15:38
 To: [EMAIL PROTECTED]
 Subject: [R] Searching for a string in RSQLite
 
 
 I'd like to search for a particular string in an SQLite 
 database using RSQLite, but I'm running into problems 
 constructing the query properly, because of embedded quotes 
 and parens in the string.
 
 Is there a function that escapes these for me, or some other 
 fixup that would let me do the queries below?  In the real 
 situation I don't have control over what strings get searched for.
 
 Example based on ?SQLite:
 
  library(RSQLite)
  m - dbDriver(SQLite)
  con - dbConnect(m, dbname = base.dbms)
  data(USArrests)
  dbWriteTable(con, USArrests, USArrests, overwrite = T)
 [1] TRUE
  state - Wyoming
 
 # this works fine:
 
  dbGetQuery(con, paste(SELECT * from USArrests where 
  row_names=',state,',sep=))
   row_names Murder Assault UrbanPop Rape
 1   Wyoming6.8 161   60 15.6
 
 # Buf if the search string contains characters that SQL 
 interprets, I # get an error
 
  state - messy:  ' (
  dbGetQuery(con, paste(SELECT * from USArrests where 
  row_names=',state,',sep=))
 Error in sqliteExecStatement(con, statement) : 
 RS-DBI driver: (error in statement: near (: syntax error)
 
 Duncan Murdoch
 
 __
 [EMAIL PROTECTED] mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 

The normal character for escaping the next character to prevent it being
interpreted in SQL (including SQLite) is the backslash (i.e. \). Unless, of
course, I'm not understanding the precise nature of your request.

Regards

Mike

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-10 Thread Dr Mike Waters

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz
 Sent: 09 August 2004 15:13
 To: Dr Mike Waters
 Cc: R-Help
 Subject: RE: [R] R packages install problems linux - X not 
 found (WhiteBoxEL 3)
 
 
 On Mon, 2004-08-09 at 08:13, Dr Mike Waters wrote:
 
 snip
 
  Marc,
  
  Sorry for the confusion yesterday - in my defence, it was 
 very hot and 
  humid here in Hampshire (31 Celsius at 15:00hrs and still 25 at 
  20:00hrs).
  
  What had happened was that I had done a clean install of WB Linux, 
  including the XFree86 and other developer packages. However, the 
  on-line updating system updated the XFree86 packages to a newer sub 
  version. It seems that it didn't do this correctly for the XFree86 
  developer package, which was missing vital files. However 
 it showed up 
  in the rpm database as being installed (i.e. rpm -qa | grep XFree 
  showed it thus). I downloaded another rpm for this manually 
 and I only 
  forced the upgrade because it was the same version as already 
  'installed' (as far as the rpm database was concerned). I 
 assumed that 
  all dependencies were sorted out through the install in the first 
  place.
 
 OK, that helps. I still have a lingering concern that, given 
 the facts above, there may be other integrity issues in the 
 RPM database, if not elsewhere.
 
 From reading the WB web site FAQ's
 (http://www.whiteboxlinux.org/faq.html) , it appears that 
 they are using up2date/yum for system updates. Depending upon 
 the version in use, there have been issues especially with 
 up2date (hangs, incomplete updates,
 etc.) which could result in other problems. I use yum via the 
 console here (under FC2), though I note that a GUI version of 
 yum has been created, including replacing the RHN/up2date 
 system tray alert icon.
 
 A thought relative to this specifically:
 
 If there is or may be an integrity problem related to the rpm 
 database, you should review the information here:
 
 http://www.rpm.org/hintskinks/repairdb/
 
 which provides instructions on repairing the database. Note 
 the important caveats regarding backups, etc.
 
 The two key steps there are to remove any residual lock files 
 using (as
 root):
 
 rm -f /var/lib/rpm/__*
 
 and then rebuilding the rpm database using (also as root):
 
 rpm -vv --rebuilddb
 
 I think that there needs to be some level of comfort that 
 this basic foundation for the system is intact and correct.
 
  I only mentioned RH9 to show that I had some familiarity with the 
  RedHat policy of separating out the 'includes' etc into a separate 
  developer package.
  
  Once all this had been sorted out, I was then left with a 
 compilation 
  error which pointed to a missing dependency or similar, 
 which was not 
  due to missing developer packages, but, as you and Prof Ripley 
  correctly point out, from the R installation itself. Having 
 grown fat 
  and lazy on using R under the MS Windows environment, I was 
 struggling 
  to identify the precise nature of this remaining problem.
  
  As regards the R installation, I did this from the RH9 binary for 
  version 1.9.1, as I did not think that the Fedora Core 2 
 binary would 
  be appropriate here. Perhaps I should now compile from the source 
  instead?
 
 I would not use the FC2 RPM, since FC2 has many underlying 
 changes not the least of which includes the use of the 2.6 
 kernel series and the change from XFree86 to x.org. Both 
 changes resulted in significant havoc during the FC2 testing 
 phases and there was at least one issue here with R due to 
 the change in X.
 
 According to the WB FAQs:
 
 If you cannot find a package built specifically for RHEL3 or 
 WBEL3 you can try a package for RH9 since many of the 
 packages in RHEL3 are the exact same packages as appeared in RH9.
 
 Thus, it would seem reasonable to use the RH9 RPM that Martyn 
 has created. An alternative would certainly be to compile R 
 from the source tarball.
 
 In either case, I would remove the current installation of R 
 and after achieving a level of comfort that your RPM database 
 is OK, reinstall R using one of the above methods. Pay close 
 attention to any output during the installation process, 
 noting any error or warning messages that may occur.
 
 If you go the RPM route, be sure that the MD5SUM of the RPM 
 file matches the value that Martyn has listed on CRAN to 
 ensure that the file has been downloaded in an intact fashion.
 
 These are my thoughts at this point. You need to get to a 
 point where the underlying system is stable and intact, then 
 get R to the same state before attempting to install new packages.
 
 HTH,
 
 Marc
 
From unpacking the tarball and running ./configure in the R source
directory, I obtain the fact that crti.o is needed by ld.so and was not
found. This file is not present on the system. This file, along with crtn.o
is usually installed by the gnu libc packages, I believe. However, I know
that not all *nix

RE: [R] R packages install problems linux - X not found(WhiteBoxEL 3)

2004-08-10 Thread Dr Mike Waters
Marc,

Yes - the glibc-devel package was shown to be installed using rpm -qa. It is
also one of the packages upgraded by up2date from the original version
supplied with the WhiteBox distribution. I concluded that there were
probably more such improperly/incompletely upgraded packages and cut my
losses. Everything seems to be fine second time around. I must have been
unlucky.

Regards

Mike

 -Original Message-
 From: Marc Schwartz [mailto:[EMAIL PROTECTED] 
 Sent: 10 August 2004 15:30
 To: Dr Mike Waters
 Cc: R-Help
 Subject: RE: [R] R packages install problems linux - X not 
 found(WhiteBoxEL 3)
 
 
 On Tue, 2004-08-10 at 08:15, Dr Mike Waters wrote:
 
 snip 
 
  From unpacking the tarball and running ./configure in the R source
  directory, I obtain the fact that crti.o is needed by ld.so and was 
  not found. This file is not present on the system. This file, along 
  with crtn.o is usually installed by the gnu libc packages, 
 I believe. 
  However, I know that not all *nix distributions include these files 
  among their packages.
  From a web search, I have not been able to ascertain whether this 
  lack of a
  crti.o is due to there not being one in the distribution, or to 
  another incomplete package install.
  
  So, I did a completely fresh installation of WhiteBox, 
 followed by R 
  built from source, checked that it ran and then installed the R 
  packages. Only then did I run up2date. At least crti.o and 
 crtn.o are 
  still there this time, along with the XFree86 includes.
  
  A bit of a cautionary tale, all in all.
  
  Thanks for all the help and support.
  
  Regards
  
  M
 
 
 Mike,
 
 From my FC2 system:
 
 $ rpm -qf /usr/lib/crti.o
 glibc-devel-2.3.3-27
 
 $ rpm -qf /usr/lib/crtn.o
 glibc-devel-2.3.3-27
 
 So, you are correct relative to the source of these two 
 files. A follow up question might be, did you include the 
 devel packages during your initial install? If not, that 
 would explain the lack of these files. if you did, then it 
 would add another data point to support the notion that your 
 system was, to some level, compromised and a clean install 
 was probably needed, rather than just trying to re-create the 
 RPM database.
 
 Glad that you are up and running at this point. Given 
 Martyn's follow up messages, it looks like there may be an 
 issue with the RH9 RPM, so for the time being using the 
 source tarball would be appropriate.
 
 Best regards,
 
 Marc
 
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-09 Thread Dr Mike Waters
 I am concerned by your indications of previously having had RH9 on the
 same box and that you had to force an update of the XFree Devel RPM.
 Forcing the installation of an RPM is almost always a bad thing.

 When you installed WB on the system, did you do a clean installation
 or some type of upgrade?

 If the latter, it is reasonable to consider that there may be some level
 of mixing and matching of RPMS from the two distributions going on. This
 could result in a level of marginally or wholly incompatible versions of
 RPMS being installed.

 Could you clarify that point?

 Also, be sure that you have the same versions of the XFree series RPMS
 installed.

 Use:

 rpm -qa | grep XFree

 in a console and be sure that the RPMS return the same version schema.
 If not, it is possible that one of your problems is the mixing of
 versions.

 Take note of the output of the above and be sure that the
 XFree86-Mesa-libGL and XFree86-Mesa-libGLU RPMS are installed as well.

 Some of the messages above would also suggest a problem finding R
 related headers. How did you install R? This may be a red herring of
 sorts, given the other problems, but may be helpful.

 Marc

 __


Marc,

Sorry for the confusion yesterday - in my defence, it was very hot and humid
here in Hampshire (31 Celsius at 15:00hrs and still 25 at 20:00hrs). 

What had happened was that I had done a clean install of WB Linux, including
the XFree86 and other developer packages. However, the on-line updating
system updated the XFree86 packages to a newer sub version. It seems that it
didn't do this correctly for the XFree86 developer package, which was
missing vital files. However it showed up in the rpm database as being
installed (i.e. rpm -qa | grep XFree showed it thus). I downloaded another
rpm for this manually and I only forced the upgrade because it was the same
version as already 'installed' (as far as the rpm database was concerned). I
assumed that all dependencies were sorted out through the install in the
first place.

I only mentioned RH9 to show that I had some familiarity with the RedHat
policy of separating out the 'includes' etc into a separate developer
package.

Once all this had been sorted out, I was then left with a compilation error
which pointed to a missing dependency or similar, which was not due to
missing developer packages, but, as you and Prof Ripley correctly point out,
from the R installation itself. Having grown fat and lazy on using R under
the MS Windows environment, I was struggling to identify the precise nature
of this remaining problem.

As regards the R installation, I did this from the RH9 binary for version
1.9.1, as I did not think that the Fedora Core 2 binary would be appropriate
here. Perhaps I should now compile from the source instead?

Regards

M

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R packages install problems linux - X not found (WhiteBox EL 3)

2004-08-08 Thread Dr Mike Waters
Good evening everyone,

 

I am used to using R under Windows, but have done an install of 1.9.1 under
WhiteBox linux 3 (based on RHEL 3). This all went without a hitch, along
with most of the additional package installs. However, while trying to
install car and rgl I hit a problem regarding the X environment not being
found. As I was doing the install from a console *within* the X environment,
this is obviously down to a missing environment variable or link. The X11
directories all seem to be in the usual places. I've checked as much as I
can through the archives and googled around, but to no avail. Any help
appreciated.

 

Thanks for taking the time to read this.

 

Regards

 

M


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


FW: [R] R packages install problems linux - X not found (WhiteBoxEL 3)

2004-08-08 Thread Dr Mike Waters


-Original Message-
From: Dr Mike Waters [mailto:[EMAIL PROTECTED] 
Sent: 08 August 2004 20:11
To: '[EMAIL PROTECTED]'
Subject: RE: [R] R packages install problems linux - X not found (WhiteBoxEL
3)

-Original Message-
 Correction on the above URL. I pasted the wrong one here. It should be:

 https://www.stat.math.ethz.ch/pipermail/r-help/2004-August/053994.html

 Marc



Thanks for the responses guys.

I used to have RH9 installed on this machine and I found out about the
separate developer packages then. I thought that I had got the relevant
XFree devel package installed, but although it showed up in the rpm database
as being present, the required files were not present. I did a forced rpm
upgrade from the WhiteBox updates directory and that problem is now fixed,
at least for car. Marc, thanks for the pointer on the rgl problem. However,
I have a slightly different problem with the install of this package. It
gets through to the point where it tries to make the rgl.so from the various
.o files and fails then, as follows:



g++ -I/usr/lib/R/include -I/usr/X11R6/include -DHAVE_PNG_H
-I/usr/include -I/usr/local/include  -Wall -pedantic -fno-exceptions
-fno-rtti -fPIC  -O2 -g -march=i386 -mcpu=i686 -c glgui.cpp -o glgui.o

g++  -L/usr/local/lib -o rgl.so x11lib.o x11gui.o types.o math.o fps.o
pixmap.o gui.o api.o device.o devicemanager.o rglview.o scene.o glgui.o
-L/usr/X11R6/lib -L/usr/lib -lstdc++ -lX11 -lXext -lGL -lGLU -lpng
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/../../../crt1.o(.text+0x18): In
function `_start':
: undefined reference to `main'
x11lib.o(.text+0x84): In function `set_R_handler':
/tmp/R.INSTALL.13414/rgl/src/x11gui.h:33: undefined reference to
`R_InputHandlers'
x11lib.o(.text+0x92):/tmp/R.INSTALL.13414/rgl/src/x11gui.h:33: undefined
reference to `addInputHandler'
x11lib.o(.text+0xfb): In function `unset_R_handler':
/tmp/R.INSTALL.13414/rgl/src/x11lib.cpp:52: undefined reference to
`R_InputHandlers'
x11lib.o(.text+0x103):/tmp/R.INSTALL.13414/rgl/src/x11lib.cpp:52:
undefined reference to `removeInputHandler'
collect2: ld returned 1 exit status
make: *** [rgl.so] Error 1
ERROR: compilation failed for package 'rgl'
** Removing '/usr/lib/R/library/rgl'

-

No doubt another failed dependency... DOH!

Regards

M

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html