similar to: SQL/R

Displaying 20 results from an estimated 7000 matches similar to: "SQL/R"

2010 Aug 10
1
[Fwd: Re: optimization subject to constraints]
-------------- next part -------------- An embedded message was scrubbed... From: Gildas Mazo <gildas.mazo at curie.fr> Subject: Re: [R] optimization subject to constraints Date: Tue, 10 Aug 2010 15:49:19 +0200 Size: 4924 URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100810/78862894/attachment.eml>
2010 Apr 28
1
function which saves an image of a dgtMatrix as png
Hi, I'm getting crazy: This does work: library(Matrix) a1<-b1<-c(1,2) c1<-rnorm(2) aDgt<-spMatrix(ncol=3,nrow=3,i=a1,j=b1,x=c1) png("myImage.png") image(aDgt) dev.off() But this doesn't !!! f<-function(x){ png("myImage.png") image(x) dev.off() } f(aDgt) My image is saved as a text file and contains nothing at all !!! Thanks in advance, Gildas Mazo
2010 Jun 04
2
Build Design Matrix with avoiding loops
Dear R users, I'd like to build a simple design matrix in a efficient way. I naively wrote the code below. #### n = 15 k = 3 nbPerGrp = c(5,5,5) xT <- list() for (i in 1:k){ xT[[i]] <- rep(0, k) xT[[i]][i] <- 1 } X <- matrix(nrow = n, ncol = k) #design matrix for (i in 1:nbPerGrp[1]){ X[i,] <- xT[[1]] } for (i in 1:k-1){ for (j
2012 Mar 06
2
Numerical Inversion of Cumulative Distribution Function
Dear R users, Given a user-defined cumulative distribution function F, I want to compute F^{-1}(x). How is that possible with R? Best Regards, -- Gildas Mazo PhD student MISTIS team at INRIA Grenoble, France [[alternative HTML version deleted]]
2010 Aug 09
2
optimization subject to constraints
Dear R users, I'm looking for tools to perform optimization subject to constraints, both linear and non-linear. I don't mind which algorithm may be used, my primary aim is to get something general and easy-to-use to study simples examples. Thanks for helping, Gildas
2012 Sep 20
1
optim and "the function should not" advice
Dear R users, I'm using optim to optimize a pretty complicated function. This function takes the parameter vector "theta" and within its body I use instructions like sigma<-theta[a:b]; computations with sigma... out<-c() for (i in 1:d){ a<-theta[(3*d+i):c] out[i]<-evaluation of an expression involving 'a' (I use symbolic differentiation) } Unfortunately
2012 Mar 22
4
Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!
Hello All, Want very much to learn how to plot patient drug timelines. Trouble is I need to figure out how to do this today. So not much time for me to struggle with it. Hoping someone can just help me out a bit. Below are some sample data and code that produces what I think is the beginning of a very nice graph. Need to alter the code to: 1. Get the lines for the drugs to appear on the
2010 Mar 25
3
Absolutely No idea how to plot my Spatial Data
Hi, I have a data set of points which are represented by 3 variables x,y,z where x is the position of the point on the x-absciss and y on the y-absciss. Each of my points has a value z, which I want to be displayed as follows: the more z is high, the more the color on the map is dark. How can I achieve this ? Thanks for your help -- View this message in context:
2015 Jul 27
2
Error sql en función
Hola: No consigo que la función sqldf () funcione dentro de una función. Alguien puede echarme una mano. En resumen, el problema es que cuando lo ejecuto fuera de una función no tengo ningún problema: ========================== > # install.packages("sqldf") > library(MASS) > library (sqldf) > data(Aids2, package="MASS") > options(digits=3) > table
2015 Jul 27
2
Error sql en función
Hola Carlos: Gracias por responder! Ayer caí en esta página al buscar el problema con google, pero no conseguir entender y implementar lo que sugiere. Sin entender nada, lo que hice fue: ======================== > library(MASS) > library (sqldf) # Per SQL > data(Aids2, package="MASS") > SQL_PROVA = function (XDADES, XWHE) + { + XDADES_SQL = sqldf ("select * from
2011 Apr 13
1
Decimals in R/SQL
Hello, When I am writing in sqldf or RSQLite I lose the decimals in my matrix. The only way I can get decimals is by multiplying by 1.00000, etc. I have tried manipulating the options, but it is only effective once I multiply by 1.0000. I appreciate any suggestions! Thanks! Example: z <- sqldf ("select ST, SUM(AGEP*PWGTP)*1.000000000/SUM(PWGTP)*1.00000000000000 as wgtage from ss09
2010 Mar 22
1
SQL-select using native R methods ?
Hi I have a problem in R that I have been trying to solve but without success. I am trying to join two tables on two variables : an ID and a date (optional) that will be common between the two tables In SQL (and SAS PROC SQL) I am a frequent user of the "select" command and I am used to the following nomenclature : select a.*, b.c, b.y, b.z from table1 a, table2 b where
2010 Mar 24
2
translating SQL statements into data.table operations
I've recently stumbled across data.table, Matthew Dowle's package. I'm impressed by the speed of the package in handling operations with large data.frames, but am a bit overwhelmed with the syntax. I'd like to express the SQL statement below using data.table operations rather than sqldf (which was incredibly slow for a small subset of my financial data) or import/export with a
2011 Jun 24
2
SQL Changing Data Type
Passing in two dates to a sql statement (sqldf). Is returning a factor. Tried setting back to a Date via as.Date, but get an error the error: character string is not in a standard unambiguous format. Any thoughts appreciated. Code/Results listed below: > summary(df.possible.combos) Date Hour Min. :2011-03-01 Min. : 0.00 1st Qu.:2011-03-23 1st Qu.: 5.75
2016 Jun 22
2
Ayuda sencilla (SQL)
Estoy en 3.3.0 y "sqldf" lo instala sin problemas... El 23 de junio de 2016, 1:23, Mauricio Monsalvo <m.monsalvo en gmail.com> escribió: > Malas nuevas para mi: > package ?sqldb? is not available (for R version 3.3.0) > ¿Puedo hacer algo más que esperar? No me voy a "bajar" de versión de R. > > El 22 de junio de 2016, 20:02, Mauricio Monsalvo
2011 Aug 22
3
Ignoring loadNamespace errors when loading a file
On a Unix machine I ran caret::rfe using the multicore package, and I saved the resulting object using save(lm2, file = "lm2.RData"). [Reproducible example below.] When I try to load("lm2.RData") on my Windows laptop, I get Error in loadNamespace(name) : there is no package called 'multicore' I completely understand the error and I would like to ignore it and
2016 Jun 22
2
Ayuda sencilla (SQL)
Muchas gracias, Carlos. Sobre todo por el sqldf, que seguro me ahorre mucho tiempo. La opción que se plante de primero d <- table(tips$day) y luego dim(d) me parece menos eficiente y cómo que directamente sqldf("select count(distinct day) from tips"), pero supongo que esos son gustos! También son "cómodas" las líneas: aggregate(subjectid ~ cond, data = dat, FUN = function(x)
2012 Nov 23
3
read.csv.sql() to select from a large csv file
Dear list,   Dear list, I am using read.csv.sql() from the sqldf package to read individual-based data from a csv file that is too large for R. My original file contains a column called “ID” that identifies the individual. I would like to read in data for only one individual at a time, for example "Bobby". read.csv.sql("filename",sql = 'select * from file where ID =
2010 Jul 27
3
Checking package licences including dependencies?
I only recently discovered options("available_packages_filters" = list(add = TRUE, "license/FOSS")) [cf. help("available.packages", package="utils") in R 2.10.0 or later] which goes nicely with my options("checkPackageLicense" = TRUE) [new in R 2.11]. But now I want to purge my library of packages I would not have installed had I known about
2007 Sep 07
5
SQL like function?
Hi RUsers, I am wonder if I can search observations whose IDs matches any of the values in another vector, such as in MySQL. While I am learing MySQL for future database management, I appreciate if anyone could give me a hint. Suppose I have one 5*1 vector containing observation IDs and frequencies, and one 3*1 vector containing observation IDs. observation<-c(1,2,3,4,5) ID<-c(1,3,4)