<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Roney,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; ">eu escrevi um exemplo abaixo baseado em scripts que eu tenho aqui. Não sei se vai servir no seu caso, mas é um caminho. Essencialmente, para ler os dados, as opções apresentadas são os pacotes sqldf e ff (e ffbase para algumas funções úteis) e biglm para a regressão.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0);
background-color: transparent; font-style: normal; ">Att.,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; ">Rubem</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; "><br></div><div style="background-color: transparent; "><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">library(sqldf)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">library(biglm)</font></div><div style="background-color: transparent; "><font size="2"
style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">library(ffbase)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"># Criando dados fictícios</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">id <- 1:1e5</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">xy <- matrix(rnorm(11e5),1e5,11)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">dat0 <- cbind(id, xy)</font></div><div
style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">dat <- as.data.frame(dat0)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">names(dat) <- c('id', 'y', paste('x',1:10,sep=""))</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">write.csv(dat, 'dat.teste.csv', row.names=F)</font></div><div style="background-color: transparent; "><span style="font-family: 'Courier New',
courier, monaco, monospace, sans-serif;"><br></span></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">## Passando os dados para um formato de base de dados</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">sqldf("attach dbtest as new")</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">read.csv.sql("dat.teste.csv", "create table main as select * from file",</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"> dbname="dbtest")</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New',
courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><span style="font-size: 13px; background-color: transparent; ">## Lendo os dados via query e ajustando modelo de regressão</span><br></span></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">drv<-dbDriver("SQLite")</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">con<-dbConnect(drv, dbname='dbtest')</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco,
monospace, sans-serif;">dbListTables(con)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"># "head()"</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">dbGetQuery(con, "select * from main limit 6")</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">m0<-bigglm(y~x1+x2, data=con, tablename='main', chunksize=5e4)</font></div><div style="background-color:
transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">summary(m0)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">dbDisconnect(con)</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><span style="font-size: 13px; background-color: transparent; ">## Alternativamente:
Lendo de um arquivo CSV</span><br></span></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">cc<-c('factor',rep('numeric',11))</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">tes.dat<-read.table.ffdf(file='dat.teste.csv', FUN='read.csv',</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"> colClasses=cc,na.strings="")</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;"><br></font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New',
courier, monaco, monospace, sans-serif;"># Subconjunto de dados</font></div><div style="background-color: transparent; "><font size="2" style="font-family: 'Courier New', courier, monaco, monospace, sans-serif;">tes.dat2<-subset(tes.dat, tes.dat$y > 1)</font></div></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br> </div> </div> </div></body></html>