search for: alltables

Displaying 5 results from an estimated 5 matches for "alltables".

Did you mean: all_tables
2012 Sep 19
1
scraping with session cookies
...ree") cf <- "cookies.txt" no_cookie <- function() { curlHandle <- getCurlHandle(cookiefile=cf, cookiejar=cf) getURL(site, curl=curlHandle) rm(curlHandle) gc() } if ( file.exists(cf) == TRUE ) { file.create(cf) no_cookie() } allTables <- readHTMLTable(site) allTables [[alternative HTML version deleted]]
2009 Feb 20
2
importing data to SQLite database with sqldf
...rbind' them into a new table using 'union all'? The following code is what I have (the part where I read in each file before dumping into the database file would hopefully be replaced by the method above, if it can be made to work). ## (1) create a database file sqldf("attach 'alltables.db' as new") ## (2) convenience function sql <- function(...) sqldf(...,dbname="alltables.db") ## (3) load data as separate tables for( fi in list.files(".","txt$") ) { mydata <- read.delim(fi) sql(sprintf("create table %s as select * from mydat...
2007 Aug 14
4
Import of Access data via RODBC changes column name ("NO" to "Expr1014") and the content of the column
..., .t, "from", name) .d <- try(sqlQuery(.con, .t), silent = T) if(inherits(.d, "try-error")){close(.con); return(.d)} .con <- try(close(.con), silent = T) if(inherits(.con, "try-error")) return(.con) .d <- .d[!names(.d) %in% drop] return(.d) } get.alltables <- function(db){ .con <- try(odbcConnectAccess(db), silent = T) if(!inherits(.con, "RODBC")) return(.con) .tbls <- try(sqlTables(.con)[["TABLE_NAME"]]) if(inherits(.tbls, "try-error")){close(.con); return(.tbls)} .con <- try(close(.con), silent =...
2010 Oct 10
1
Create single vector after looping through multiple data frames with GREP
...truly, Simon Kiss #This is the reproducible code to set-up all the data frames require("XML") library(XML) #This gets the data from the web and lists them mylist <- paste ("http://www.queensu.ca/cora/_trends/mip_", c(1987:2001,2003:2006), ".htm", sep="") alltables <- lapply(mylist, readHTMLTable) #convert to dataframes r<-lapply(alltables, function(x) {as.data.frame(x)} ) #This is just some house-cleaning; structuring all the tables so they are uniform r[[1]][3]<-r[[1]][2] r[[1]][2]<-c(" ") r[[2]][4]<-r[[2]][2] r[[2]][5]<-r[[2]...
2004 Jun 17
2
nlme graphics in a loop problem
Hi, I'm fitting mixed effects models using the lme function of the nlme package. This involves using the various associated plot functions. However, when I attempt to fit a number of models using an loop, whilst the models work, the plot functions fail. As a trivial example, the following works: library(nlme) graphics.off() x<-c(1:10) y<-c(1:4,7:12)