[R] Public R servers?
Hello, Earlier I posted a question about memory usage, and the community's input was very helpful. However, I'm now extending my dataset (which I use when running a regression using lm). As a result, I am continuing to run into problems with memory usage, and I believe I need to shift to implementing the analysis on a different system.. I know that R supports R servers through Rserve. Are there any public servers where I could upload my datasets (either as a text file, or through a connection to a SQL server), execute the analysis, then download the results? I identifed Wessa.net (http://www.wessa.net/mrc.wasp?outtype=Browser%20Blue%20-%20Charts%20White), but it's not clear it will meet my needs. Can anyone suggest any other resources? Thanks in advance, Aaron Barzilai [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help with R and MySQL
Hello, This forum has been very helpful to me in the past, and I've run out of ideas on how to solve my problem. I had been using R and MySQL (and Perl) together for quite some time successfully on my Windows XP machine. However, I recently had some problems with MySQL (the ibdata file had become 35GB on my hard drive, turns out it's a known bug with InnoDB), and ultimately the way I fixed my problem with MySQL was to upgrade it. It's working fine now, I can use MySQL however I'd like. I'm sticking to MyISAM tables for now, though. However, I had set up my system so I did a linear regression in R. Originally, this was done in R 2.5.0, I would load in the tables from MySQL to R and then conduct the regression in R. However, after solving my MySQL problem, I ran into a strange error in R (and DBI/RMySQL). R connected to the database just fine, and I could even show the tables in the database and load two of them into R. However, the tables I loaded successfully were only a single column. Every time I tried to load in a recordset that was multiple columns, I got a relatively nondescript Windows error(R for Windows terminal front-end has encountered a problem and needs to close. We are sorry for the inconvenience.). To verify that it wasn't a memory issue, I even tried rs - dbSendQuery(con, select 'a', 'b'). This statement causes the error as well. I tried upgrading the packages, and upgrading R from 2.5.0 to 2.8.1. However, I still get the same errors. Has anyone run into this problem before? Any suggestions on how to solve it? Thanks in advance, Aaron [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help with R and MySQL
Thanks Jeff, that was exactly the problem. When I unzipped the version at the page below for my version of MySQL (5.1), it worked fine. The version I downloaded through install.packages() must have been for 5.0. Thanks so much for the help and quick response, Aaron From: Jeffrey Horner jeff.hor...@vanderbilt.edu Cc: R-help@r-project.org Sent: Monday, February 23, 2009 10:10:02 AM Subject: Re: [R] Help with R and MySQL Aaron Barzilai wrote: Hello, This forum has been very helpful to me in the past, and I've run out of ideas on how to solve my problem. I had been using R and MySQL (and Perl) together for quite some time successfully on my Windows XP machine. However, I recently had some problems with MySQL (the ibdata file had become 35GB on my hard drive, turns out it's a known bug with InnoDB), and ultimately the way I fixed my problem with MySQL was to upgrade it. It's working fine now, I can use MySQL however I'd like. I'm sticking to MyISAM tables for now, though. However, I had set up my system so I did a linear regression in R. Originally, this was done in R 2.5.0, I would load in the tables from MySQL to R and then conduct the regression in R. However, after solving my MySQL problem, I ran into a strange error in R (and DBI/RMySQL). R connected to the database just fine, and I could even show the tables in the database and load two of them into R. However, the tables I loaded successfully were only a single column. Every time I tried to load in a recordset that was multiple columns, I got a relatively nondescript Windows error(R for Windows terminal front-end has encountered a problem and needs to close. We are sorry for the inconvenience.). To verify that it wasn't a memory issue, I even tried rs - dbSendQuery(con, select 'a', 'b'). This statement causes the error as well. I tried upgrading the packages, and upgrading R from 2.5.0 to 2.8.1. However, I still get the same errors. Has anyone run into this problem before? Any suggestions on how to solve it? Hi Aaron, Be sure to read the details of the RMySQL web page: http://biostat.mc.vanderbilt.edu/RMySQL You need to make sure and match the version of your MySQL client library (not the running MySQL server) with the RMySQL binary that you choose from the web page above. Best, Jeff -- http://biostat.mc.vanderbilt.edu/JeffreyHorner [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help with lm and multiple linear regression?
Hello, I'm new to R, but I've read the intro to R and successfully connected it to an instance of mysql. I'm trying to perform multiple linear regression, but I'm having trouble using the lm function. To start, I have read in a simply y matrix of values(dependent variable) and x matrix of independent variables. It says both are data frames, but lm is giving me an error that my y variable is a list. Any suggestions on how to do this? It's not clear to me what the problem is as they're both data frames. My actual problem will use a much wider matrix of coefficients, I've only included two for illustration. Additionally, I'd actually like to weight the observations. How would I go about doing that? I also have that as a separate column vector. Thanks, Aaron Here's my session: margin margin 166.67 2 -58.33 3 100.00 4 -33.33 5 200.00 6 -83.33 7 -100.00 8 0.00 9 100.00 10 -18.18 11 -55.36 12 -125.00 13 -33.33 14 -200.00 150.00 16 -100.00 17 75.00 180.00 19 -200.00 20 35.71 21 100.00 22 50.00 23 -86.67 24 165.00 personcoeff Person1 Person2 1 -1 1 2 -1 1 3 -1 1 4 -1 1 5 -1 1 6 -1 1 70 0 80 0 90 1 10 -1 1 11 -1 1 12 -1 1 13 -1 1 14 -1 0 15 0 0 16 0 0 17 0 1 18 -1 1 19 -1 1 20 -1 1 21 -1 1 22 -1 1 23 -1 1 24 -1 1 class(margin) [1] data.frame class(personcoeff) [1] data.frame lm(margin~personcoeff) Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : invalid type (list) for variable 'margin' Be a better friend, newshound, and [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help with lm and multiple linear regression? (Plain Text version)
(Apologies the previous version was sent as rich text) Hello, I'm new to R, but I've read the intro to R and successfully connected it to an instance of mysql. I'm trying to perform multiple linear regression, but I'm having trouble using the lm function. To start, I have read in a simply y matrix of values(dependent variable) and x matrix of independent variables. It says both are data frames, but lm is giving me an error that my y variable is a list. Any suggestions on how to do this? It's not clear to me what the problem is as they're both data frames. My actual problem will use a much wider matrix of coefficients, I've only included two for illustration. Additionally, I'd actually like to weight the observations. How would I go about doing that? I also have that as a separate column vector. Thanks, Aaron Here's my session: margin margin 166.67 2 -58.33 3 100.00 4 -33.33 5 200.00 6 -83.33 7 -100.00 8 0.00 9 100.00 10 -18.18 11 -55.36 12 -125.00 13 -33.33 14 -200.00 150.00 16 -100.00 17 75.00 180.00 19 -200.00 20 35.71 21 100.00 22 50.00 23 -86.67 24 165.00 personcoeff Person1 Person2 1 -1 1 2 -1 1 3 -1 1 4 -1 1 5 -1 1 6 -1 1 70 0 80 0 90 1 10 -1 1 11 -1 1 12 -1 1 13 -1 1 14 -1 0 15 0 0 16 0 0 17 0 1 18 -1 1 19 -1 1 20 -1 1 21 -1 1 22 -1 1 23 -1 1 24 -1 1 class(margin) [1] data.frame class(personcoeff) [1] data.frame lm(margin~personcoeff) Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : invalid type (list) for variable 'margin' Be a better friend, newshound, and __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help with lm and multiple linear regression? (Plain Text version)
Tim (and others who responded privately), Thanks for the help, this approach did work. I have also reread ?lm a little more closely, I do see the weights functionality. I have one last question: Now that I understand how to call this function and review the results, I want to extend it to my much larger real problem, with 100s of columns. Is there a way to call the function in more of a matrix algebra syntax, where I would list the matrix(e.g. personcoeff) rather than the individual column names? It seems like I might need to use lm.wfit, but per the help I'd rather use lm. Thanks, Aaron - Original Message From: Tim Calkins [EMAIL PROTECTED] To: Aaron Barzilai [EMAIL PROTECTED] Cc: r-help@r-project.org Sent: Thursday, December 27, 2007 6:55:57 PM Subject: Re: [R] Help with lm and multiple linear regression? (Plain Text version) consider merging everything into a singe dataframe. i haven't tried it, but something like the following could work: reg.data - cbind(margin, personcoeff) names(reg.data) - c('margin', 'p1', 'p2') lm(margin~p1+p2, data = reg.data) the idea here is that by specifying the data frame with the data argument in lm, R looks for the columns of the names specified in the formula. for weights, see ?lm and look for the weights argument. cheers, tc On Dec 28, 2007 10:22 AM, Aaron Barzilai [EMAIL PROTECTED] wrote: (Apologies the previous version was sent as rich text) Hello, I'm new to R, but I've read the intro to R and successfully connected it to an instance of mysql. I'm trying to perform multiple linear regression, but I'm having trouble using the lm function. To start, I have read in a simply y matrix of values(dependent variable) and x matrix of independent variables. It says both are data frames, but lm is giving me an error that my y variable is a list. Any suggestions on how to do this? It's not clear to me what the problem is as they're both data frames. My actual problem will use a much wider matrix of coefficients, I've only included two for illustration. Additionally, I'd actually like to weight the observations. How would I go about doing that? I also have that as a separate column vector. Thanks, Aaron Here's my session: margin margin 166.67 2 -58.33 3 100.00 4 -33.33 5 200.00 6 -83.33 7 -100.00 80.00 9 100.00 10 -18.18 11 -55.36 12 -125.00 13 -33.33 14 -200.00 150.00 16 -100.00 17 75.00 180.00 19 -200.00 20 35.71 21 100.00 22 50.00 23 -86.67 24 165.00 personcoeff Person1 Person2 1 -1 1 2 -1 1 3 -1 1 4 -1 1 5 -1 1 6 -1 1 70 0 80 0 90 1 10 -1 1 11 -1 1 12 -1 1 13 -1 1 14 -1 0 15 0 0 16 0 0 17 0 1 18 -1 1 19 -1 1 20 -1 1 21 -1 1 22 -1 1 23 -1 1 24 -1 1 class(margin) [1] data.frame class(personcoeff) [1] data.frame lm(margin~personcoeff) Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : invalid type (list) for variable 'margin' Be a better friend, newshound, and __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Tim Calkins 0406 753 997 Be a better friend, newshound, and __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.