Notes on R statistics and programming language

Saturday, March 15, 2003

Trying to speed up the boot on the home XP machine. Ran defragmenter two nights ago and downloaded (from MS) and ran bootvis.exe this morning.

Thursday, March 13, 2003

# Basic RMySQL tasks after connecting (see previous entry)

## List available tables
dbListTables(con)

## get the whole table
dbReadTable(con, "tablename")

## Select from the loaded table: all on one line
dbGetQuery(con, "select row_names, Murder from arrests where Rape > 30 order by Murder")

## Write a table
dbWriteTable(con, "arrests", USArrests, overwrite = TRUE)


## Disconnect
dbDisconnect(con)
Notes on R - MySQL - and very large regressions.

See < a href="http://www.econ.uiuc.edu/~anovo/LM.html">http://www.econ.uiuc.edu/~anovo/LM.html for some useful notes by Koenker and Novo.



# Put location of libmysqlclient.so in LD_LIBRARY_PATH at R start time:

export LD_LIBRARY_PATH=/usr/local/lib/mysql/


# Here is the working combination for dbConnect

m <- dbDriver("MySQL")

con <- dbConnect(m, user="root" , password="XXXXXX" , host = "thom-80.dhcp.umass.edu" , dbname = "junk")

# Don't forget the period in localhost.

con1 <- dbConnect(m, user="mash" , password="XXXXXX" , host = "localhost." , dbname = "mash")


dbf2mysql is working, see version 1.14
./mysql-downloads/dbf2mysql-1.14/dbf2mysql -h localhost. -d mash -t costat44 -c -P XXXXXX -U mash /mnt/cdrom/data/COSTAT44.DBF

This page is powered by Blogger. Isn't yours?