Re: [R] How to install RMySQL package in R 2.5 in Windows OS?
Prof Brian Ripley wrote: On Wed, 13 Jun 2007, Ruixin ZHU wrote: Dear R-users, It seems that install.packages( ) doesn't work to RMySQL package. Under Windows, yes. You need the MySQL client libraries for your version of MySQL (or something very close to the same version), so the only safe way is to install from the sources. The latter is not hard and there are instructions in the package. There are several of us working on updating the RMySQL binary for windows. Currently one has it compiled with mysql 5.0.18, but can't get it to compile with 5.0.41. I am having trouble with 5.0.22, 5.0.24, and 5.0.37 mysql binaries. There seems to be some problems with different versions of mysql. As soon as we have a tested version of the windows binary for RMySQL, information for obtaining it will be posted. We all appreciate you patiences. Thank you Joe Would anybody have the experience of that? Thanks _ Dr.Ruixin ZHU Shanghai Center for Bioinformation Technology [EMAIL PROTECTED] [EMAIL PROTECTED] 86-21-13040647832 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Unable to load RMySQL
All, I have been down for the past two weeks moving from Tulsa to Houston for a new job. I just got internet access yesterday at our new home. I will be working on the RMySQL binary later this week if possible. There is a hitch in compiling the binary. I have the binaries for an older version of MySQL on which the R compilation worked. A newer version of MySQL 5.0.37, I never was able to get the R binaries to compile. I appreciate your patience here because I have a new job and my family and I are trying to organize our new home right now. Thank you Joe Henric Nilsson (Public) wrote: Den Ti, 2007-02-13, 11:43 skrev Ravi S. Shankar: Hi R users, I am unable to load RMySQL. The zip file is not available which I guess is needed to load this pakage. Please read http://cran.r-project.org/bin/windows/contrib/2.4/ReadMe to find out why. I also tried extracting the package from RMySQL_0.5-11.tar.gz and then pasted the package in the directory where R is loaded for which I am getting the following error message Error in library(RMySQL) : 'RMySQL' is not a valid package -- installed 2.0.0? Did you really expect that to work? Any help would be welcome Joe Byers (http://bus.cba.utulsa.edu/byersj/Research.asp) kindly provides a Windows binary of RMySQL. HTH, Henric Thank you, Ravi [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Install RMySQL with R 2.4.0
This is a test to get my new subscription upgraded. forgive me. thank you Joe Joe Byers wrote: All, I am glad all of you have benefited from the posting of the RMySQL 5-10 zip file on my university website. I am asking for some help from the group, I am leaving the university at the end of the semester and I need a place to post this file until I get settled in my new position. Anyone that can help me or us out with this. It would be greatly appreciated. Thank you Joe Frank McCown wrote: Joe Byers wrote: All, After staring at this error message for an hour or so yesterday and this morning. I decided to try something else. Low and behold trying to build the package in cygwin causes R to try and build under linux/unix not windows. I went to the command prompt and was able to build the package. Download the RMySQL...tar.gz file and unzip somewhere like drive:/projects Several notes 1. make sure you have mysql directories on your computer somewhere with the subdirs of include, bin, and lib. You can just copy these from you actual server unless you want to install them. I used d:/mysql/... 2. Modify configure.win in RMySQL and Makevars.win ins RMySQL/src to have the mysql directories from (1) 3. Copy and paste this script to a batch file and execute ** Rem build without --docs=normal tries to build chm help on windows this bombs Rem if a zip program not installed the zip file will not be built Rem go find the temp directory where R built the package and copy to ../R/library Rem temp directory will look something like C:\Temp\Rinst32098657\RMySQL Rem if R bin directory in the path this will run otherwise add the drive:\Dir1\R\bin to the command Rcmd build --binary \projects\RMySQL --docs=normal *** 4. Note that I have --docs=normal in the command line. This is needed to get the package built. Windows packages now default to chm files and RMySQL does not have any windows chm help files. All txt, html, and latex help are built with this option. 5. I am not sure where the RMySQL...zip file is stored, I think in ...R\Bin. I just copied the files from the temp\RinstXX\to the ...\R\library to install. This may or may not work for you, it did for me. I will try and update my website www.cba.utulsa.edu/byersj Research and Analytics section to include a link to the RMySQL zip file for others to download. Good Luck Joe Joe, Thanks for telling us how you got RMySQL installed. Would you mind posting the dll files so the rest of us wouldn't have to recompile anything? Thanks, Frank __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Install RMySQL with R 2.4.0
Frank, I will post a zip file of the RMySQL 5.10 on my university web site www.cba.utulsa.edu/byersj under the Research and Analytics link in the next day or two. Here at the University we had a major technology problem in the college of business causing IT to move up a migration time table by 3 months. I am waiting on them to reset the security setting on our webserver. As soon at that is done, I will post the file and notify the mailing as well. Good Luck and give me a day or two. Joe Frank McCown wrote: Joe Byers wrote: All, After staring at this error message for an hour or so yesterday and this morning. I decided to try something else. Low and behold trying to build the package in cygwin causes R to try and build under linux/unix not windows. I went to the command prompt and was able to build the package. Download the RMySQL...tar.gz file and unzip somewhere like drive:/projects Several notes 1. make sure you have mysql directories on your computer somewhere with the subdirs of include, bin, and lib. You can just copy these from you actual server unless you want to install them. I used d:/mysql/... 2. Modify configure.win in RMySQL and Makevars.win ins RMySQL/src to have the mysql directories from (1) 3. Copy and paste this script to a batch file and execute ** Rem build without --docs=normal tries to build chm help on windows this bombs Rem if a zip program not installed the zip file will not be built Rem go find the temp directory where R built the package and copy to ../R/library Rem temp directory will look something like C:\Temp\Rinst32098657\RMySQL Rem if R bin directory in the path this will run otherwise add the drive:\Dir1\R\bin to the command Rcmd build --binary \projects\RMySQL --docs=normal *** 4. Note that I have --docs=normal in the command line. This is needed to get the package built. Windows packages now default to chm files and RMySQL does not have any windows chm help files. All txt, html, and latex help are built with this option. 5. I am not sure where the RMySQL...zip file is stored, I think in ...R\Bin. I just copied the files from the temp\RinstXX\to the ...\R\library to install. This may or may not work for you, it did for me. I will try and update my website www.cba.utulsa.edu/byersj Research and Analytics section to include a link to the RMySQL zip file for others to download. Good Luck Joe Joe, Thanks for telling us how you got RMySQL installed. Would you mind posting the dll files so the rest of us wouldn't have to recompile anything? Thanks, Frank __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Install RMySQL with R 2.4.0
Frank, While I was replying to you our IT guys sent me a message as said I could connect. I have posted the RMySQL zip file at http://bus.cba.utulsa.edu/byersj/Research.asp Good luck to all Joe Frank McCown wrote: Joe Byers wrote: All, After staring at this error message for an hour or so yesterday and this morning. I decided to try something else. Low and behold trying to build the package in cygwin causes R to try and build under linux/unix not windows. I went to the command prompt and was able to build the package. Download the RMySQL...tar.gz file and unzip somewhere like drive:/projects Several notes 1. make sure you have mysql directories on your computer somewhere with the subdirs of include, bin, and lib. You can just copy these from you actual server unless you want to install them. I used d:/mysql/... 2. Modify configure.win in RMySQL and Makevars.win ins RMySQL/src to have the mysql directories from (1) 3. Copy and paste this script to a batch file and execute ** Rem build without --docs=normal tries to build chm help on windows this bombs Rem if a zip program not installed the zip file will not be built Rem go find the temp directory where R built the package and copy to ../R/library Rem temp directory will look something like C:\Temp\Rinst32098657\RMySQL Rem if R bin directory in the path this will run otherwise add the drive:\Dir1\R\bin to the command Rcmd build --binary \projects\RMySQL --docs=normal *** 4. Note that I have --docs=normal in the command line. This is needed to get the package built. Windows packages now default to chm files and RMySQL does not have any windows chm help files. All txt, html, and latex help are built with this option. 5. I am not sure where the RMySQL...zip file is stored, I think in ...R\Bin. I just copied the files from the temp\RinstXX\to the ...\R\library to install. This may or may not work for you, it did for me. I will try and update my website www.cba.utulsa.edu/byersj Research and Analytics section to include a link to the RMySQL zip file for others to download. Good Luck Joe Joe, Thanks for telling us how you got RMySQL installed. Would you mind posting the dll files so the rest of us wouldn't have to recompile anything? Thanks, Frank __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Install RMySQL with R 2.4.0
Frank, While I was replying to you our IT guys sent me a message as said I could connect. I have posted the RMySQL zip file at http://bus.cba.utulsa.edu/byersj/Research.asp Good luck to all Joe Frank McCown wrote: Joe Byers wrote: All, After staring at this error message for an hour or so yesterday and this morning. I decided to try something else. Low and behold trying to build the package in cygwin causes R to try and build under linux/unix not windows. I went to the command prompt and was able to build the package. Download the RMySQL...tar.gz file and unzip somewhere like drive:/projects Several notes 1. make sure you have mysql directories on your computer somewhere with the subdirs of include, bin, and lib. You can just copy these from you actual server unless you want to install them. I used d:/mysql/... 2. Modify configure.win in RMySQL and Makevars.win ins RMySQL/src to have the mysql directories from (1) 3. Copy and paste this script to a batch file and execute ** Rem build without --docs=normal tries to build chm help on windows this bombs Rem if a zip program not installed the zip file will not be built Rem go find the temp directory where R built the package and copy to ../R/library Rem temp directory will look something like C:\Temp\Rinst32098657\RMySQL Rem if R bin directory in the path this will run otherwise add the drive:\Dir1\R\bin to the command Rcmd build --binary \projects\RMySQL --docs=normal *** 4. Note that I have --docs=normal in the command line. This is needed to get the package built. Windows packages now default to chm files and RMySQL does not have any windows chm help files. All txt, html, and latex help are built with this option. 5. I am not sure where the RMySQL...zip file is stored, I think in ...R\Bin. I just copied the files from the temp\RinstXX\to the ...\R\library to install. This may or may not work for you, it did for me. I will try and update my website www.cba.utulsa.edu/byersj Research and Analytics section to include a link to the RMySQL zip file for others to download. Good Luck Joe Joe, Thanks for telling us how you got RMySQL installed. Would you mind posting the dll files so the rest of us wouldn't have to recompile anything? Thanks, Frank __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Install RMySQL with R 2.4.0
I am having trouble as well with the new version of R 2.4. I downloaded the gz file from the cran website, followed the instructions in the README.win file and installed RMySQL. I have mysql installed under c:\mysql not the program files directory which is the only difference. I get the following error when I attempt to connect to the MySQL Db ## open a connection to a MySQL database con - dbConnect(dbDriver(MySQL),host='localhost', + username='',dbname = 'StorageSims'); Error in function (classes, fdef, mtable) : unable to find an inherited method for function dbConnect, for signature MySQLDriver Any help will be appreciated. I would like to note that there are no problems with RMySQL on my linux system, only on XP's. Thank you Joe Frank McCown wrote: I just installed RMySQL 0.5-9 with R 2.4.0 on Windows XP and got the following error message when trying to run a script with RMySQL: Error in library(RMySQL) : 'RMySQL' is not a valid package -- installed 2.0.0? Any ideas? Thanks, Frank __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Date, date, POSIX question
I have been working with R extensively for several months. I switched from SAS and Matlab to R. My question is Can anyone explain the benefits and detractions of the 'Date' package verses the 'date' package and verses 'POSIX' dates. I have noticed several other packages use one or the other. Rmetrics seems to standardize on POSIX. I can only see differences in default formats, and the starting counting number be it 1 1 1900 or something else. I am trying to standardize code that I write for research and to provide to my students on one date schema. The documentation is very good on using a specific package, but I can not tell the which one provides the broadest coverage across R packages or is just the better one to use. I know all of you have more experience with some of these and I am just soliciting your opinions and comments. Thank you Joe __ R-help@stat.math.ethz.ch 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] Install RMySQL with R 2.4.0
Seth Falcon wrote: Joe W. Byers [EMAIL PROTECTED] writes: I am having trouble as well with the new version of R 2.4. I downloaded the gz file from the cran website, followed the instructions in the README.win file and installed RMySQL. I have mysql installed under c:\mysql not the program files directory which is the only difference. I get the following error when I attempt to connect to the MySQL Db ## open a connection to a MySQL database con - dbConnect(dbDriver(MySQL),host='localhost', + username='',dbname = 'StorageSims'); Error in function (classes, fdef, mtable) : unable to find an inherited method for function dbConnect, for signature MySQLDriver Any help will be appreciated. I would like to note that there are no problems with RMySQL on my linux system, only on XP's. Just to make sure: Before trying the code you posted, you did library(RMySQL), right? YES Also, what versions of DBI and RMySQL are you using? RMySQL from http://cran.r-project.org/src/contrib/Descriptions/RMySQL.html DBI Version 0.1-10 according to the NEWS file in ../R/library __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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 understanding [[]] [] array, list, matrix referencing
Hi all, I would greatly appreciate some help understanding how R references arrays, matrices, lists, and objects using [[]] and []. I have read the R guides and several tutorials but I am not the fastest kid on the block so I am still having difficulty understanding this. For examples the following code produces a 5 element list of 2X5 random numbers that I then convert to a 2X5X5 matrix. cov-matrix(c(.4,-.1,-.1,.3),nrow=2,ncol=2) rnds-NULL; for (i in 1:5){ t1-rnorm(5,cov) t2-rnorm(5,cov) t3-rbind(t1,t2) rnds[i]-list(t3) } rnds.matrix-array(unlist(rnds),dim=c(2,5,5)); To access the matrix rnds.matrix I use rnds.matrix[x,y,z]. This I understand. To access the list I user [[z]][x,y]. This I do not understand. I found by chance this reference notation in an old mailing list that helped me. I could use some help in knowing when to use [[]] referencing and when to use [] referencing. If there is a really good book, webpage, or link with explanation and examples I would appreciate you forwarding the the citation. Thank you Joe __ R-help@stat.math.ethz.ch 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] inserting columns in the middle of a dataframe
Berton Gunter wrote: Please folks -- use indexing. myframe-myframe[,c(1,5,2,3,4)] Which begs the question: why bother rearranging the columns anyway, since one can get them used, printed, etc. in any order you wish anytime you want just by specifying the indices in the order you want them. I suspect the question was motivated by too much Sas- or Excel -ism. Many of the time series classes expect a date in the first column of the matrix or data.frame when creating the date-time object. Retrieving data in a SQL query from a dB returns a character representation of the date that requires conversion to a date. Performing this conversion is easy but inserting this converted date column is not straight forward. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Timothy Bates Sent: Wednesday, September 13, 2006 3:05 PM To: Jon Minton; r-help@stat.math.ethz.ch Subject: Re: [R] inserting columns in the middle of a dataframe Is there a built-in and simple way to insert new columns in a dataframe? You do this by collecting the columns in the new order you desire, and making a new frame. oldframe - data.frame(matrix(0:14,ncol=3)) newcol - data.frame(20:24) names(newcol) - newcol newframe - data.frame(c(oldframe[1],newcol, oldframe[2:3])) __ R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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@stat.math.ethz.ch 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] Formula aruguments with NLS and model.frame()
I could use some help understanding how nls parses the formula argument to a model.frame and estimates the model. I am trying to utilize the functionality of the nls formula argument to modify garchFit() to handle other variables in the mean equation besides just an arma(u,v) specification. My nonlinear model is y-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1, start=list(w=.5,a=.1,p=.5,b=init.y$coef[2],int=init.y$coef[1] ), control=list(maxiter=100,minFactor=1e-18)) where t is change in daily temperatures, id is just a time trend and the a*sin is a one year fourier series. I have tried to debug the nls code using the following code t1-data.frame(t=as.vector(x),id=index(x)) data=t1; formula - as.formula(t ~ a *sin(w *2* pi/365 * id + p) + b * id + int); varNames - all.vars(formula) algorithm-'default'; mf - match.call(definition=nls,expand.dots=FALSE, call('nls',formula, data=parent.frame(),start,control = nls.control(), algorithm = default, trace = FALSE, subset, weights, na.action, model = FALSE, lower = -Inf, upper = Inf)); mWeights-F;#missing(weights); start=list(w=.5,a=.1,p=.5,b=init.y$coef[2],int=init.y$coef[1] ); pnames - names(start); varNames - varNames[is.na(match(varNames, pnames, nomatch = NA))] varIndex - sapply(varNames, function(varName, data, respLength) { length(eval(as.name(varName), data))%%respLength == 0}, data, length(eval(formula[[2]], data)) ); mf$formula - as.formula(paste(~, paste(varNames[varIndex], collapse = +)), env = environment(formula)); mf$start - NULL;mf$control - NULL;mf$algorithm - NULL; mf$trace - NULL;mf$model - NULL; mf$lower - NULL;mf$upper - NULL; mf[[1]] - as.name(model.frame); mf-evalq(mf,data); n-nrow(mf) mf-as.list(mf); wts - if (!mWeights) model.weights(mf) else rep(1, n) if (any(wts 0 | is.na(wts))) stop(missing or negative weights not allowed) m - switch(algorithm, plinear = nlsModel.plinear(formula, mf, start, wts), port = nlsModel(formula, mf, start, wts, upper), nlsModel(formula, mf, start, wts)); I am struggling with the environment issues associated with performing these operations. I did not include the data because it is 9000 observations of temperature data. If anyone would like the data, I can provide it or a subset in a csv file. thank you Joe __ R-help@stat.math.ethz.ch 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.