[R] 2D Convolution in R
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel - (1,2,3,2,1) data - array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is there any function for 2D convolution? For theory, please refer to the following link: http://www.songho.ca/dsp/convolution/convolution2d_example.html Thank you for your help in advance. Best Regards, Wonsang [[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] 2D Convolution Function
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel - (1,2,3,2,1) data - array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is there any function for 2D convolution? For theory, please refer to the following link: http://www.songho.ca/dsp/convolution/convolution2d_example.html Thank you for your help in advance. Best Regards, Wonsang - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/2D-Convolution-Function-tp3326198p3326198.html Sent from the R help mailing list archive at Nabble.com. [[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] 2D Convolution Function
Dear R-Helpers, I want to try the 2D (two-dimensional) convolution in R. For example, let us we have the following kernel and data. kernel - (1,2,3,2,1) data - array(1:100, dim=c(10,10)) I know the function 'convolve' only for one-dimensional convolution, but it is just for a 1D sequence. Is there any function for 2D convolution? For theory, please refer to the following link: http://www.songho.ca/dsp/convolution/convolution2d_example.html Thank you for your help in advance. Best Regards, Wonsang - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/2D-Convolution-Function-tp3326158p3326158.html Sent from the R help mailing list archive at Nabble.com. [[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] Simulation of Multivariate Fractional Gaussian Noise and Fractional Brownian Motion
Dear Kjetil, Thank you so much for your advice on my question. Best Regards, Wonsang 2011/2/10 Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com What you can do to find out is to type into your R session RSiteSearch(multivariate fractional gaussian) That seems to give some usefull results. Kjetil On Tue, Feb 8, 2011 at 1:51 PM, Wonsang You y...@ifn-magdeburg.de wrote: Dear R Helpers, I have searched for any R package or code for simulating multivariate fractional Brownian motion (mFBM) or multivariate fractional Gaussian noise (mFGN) when a covariance matrix are given. Unfortunately, I could not find such a package or code. Can you suggest any solution for multivariate FBM and FGN simulation? Thank you for your help. Best Regards, Ryan - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/Simulation-of-Multivariate-Fractional-Gaussian-Noise-and-Fractional-Brownian-Motion-tp3276296p3276296.html Sent from the R help mailing list archive at Nabble.com. [[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. [[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] Large Datasets
I have not ever tried to use any GUI package. Thus, I cannot give you a good help. Instead, I would like to report my experience of exploiting the 'ff' package to have access to large dataset. To achieve your goal, I think that you need to make any function which handles ff objects. According to my experience, when I created a function which handles ff objects, it could not recognize these ff objects correctly inside the function. If you encounter such problems, you can refer to this article. http://wonsangyou.blogspot.com/2011/01/fast-access-to-large-database-in-r.html 2011/2/11 John Filben johnfil...@yahoo.com I have recently been using R - more speciifcally the GUI packages Rattle and Rcmdr. I like these products a lot and want to use them for some projects - the problem that I run into is when I start to try and run large datasets through them. The data sets are 10-15 million in record quantity and usually have 15-30 fields (both numerical and categorical). I saw that there were some packages that could deal with large datasets in R - bigmemory, ff, ffdf, biganalytics. My problem is that I am not much of a coder (and the reason I use the above mentioned GUIs). These GUIs do show the executable R code in the background - my thought was to run a small sample through the GUI, copy the code, and then incorporate some of the large data packages mentioned above - have anyone every tried to do this and would you have working examples. In terms of what I am trying to do to the data - really simple stuff - desriptive statistics, k-means clustering, and possibly some decision trees. Any help would be greatly appreciated. Thank you - John John Filben Cell Phone - 773.401.2822 Email - johnfil...@yahoo.com [[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. [[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] Simulation of Multivariate Fractional Gaussian Noise and Fractional Brownian Motion
Dear R Helpers, I have searched for any R package or code for simulating multivariate fractional Brownian motion (mFBM) or multivariate fractional Gaussian noise (mFGN) when a covariance matrix are given. Unfortunately, I could not find such a package or code. Can you suggest any solution for multivariate FBM and FGN simulation? Thank you for your help. Best Regards, Ryan - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/Simulation-of-Multivariate-Fractional-Gaussian-Noise-and-Fractional-Brownian-Motion-tp3276296p3276296.html Sent from the R help mailing list archive at Nabble.com. [[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] Error of 'memory not mapped' in ff Package with VirtualBox
Dear R Helpers, I would like to report on an error in the ff package here. The ff package is an R package which enables us to store large data on disk systematically and have fast access to the database. I used the package in Linux as a guest OS of VirtualBox, and executed the following commands. library(ff) x-ff(1:5,length=5,update=TRUE,vmode=double,filename=header.ff,overwrite=TRUE) Afterwards, I got the following error message. *** caught segfault *** address 0x, cause 'memory not mapped' Traceback: 1: .Call(get_vector, .ffmode[vmode], attr(x, physical), index, nreturn, PACKAGE = ff) 2: `[.ff`(ret, 1) 3: ret[1] 4: as.vector(ret[1]) 5: identical(as.vector(initdata[1]), as.vector(ret[1])) 6: ff(1:5, length = 5, update = TRUE, vmode = double, filename = header.ff, overwrite = TRUE) Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection: Can anyone give an advice to solve the problem? Best Regards, Ryan - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/Error-of-memory-not-mapped-in-ff-Package-with-VirtualBox-tp3253856p3253856.html Sent from the R help mailing list archive at Nabble.com. __ 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] Error of 'memory not mapped' in ff Package with VirtualBox
Dear Prof. Brian Ripley, Thank you for your kind advice. I have to report to you that I attempted to save the ff file at a shared directory between guest OS (Linux) and host OS (Windows 7). I tried to change the working directory as an unshared folder, and then I tried the same commands. In this case, I had no problem as you did. In conclusion, the ff package does not support to assign memory for shared folders between guest OS and host OS. For your reference, my experiments were done in the following environment. R version 2.12.1 (2010-12-16) Platform: i686-pc-linux-gnu (32-bit) I appreciate you for your help. Best Regards, Ryan 2011/2/2 Prof Brian Ripley rip...@stats.ox.ac.uk This is clearly a problem occuring in the C code of the ff package. Please report to the package maintainer, Cced here (with the 'at a minimum' information requested in the posting guide, most importantly the Linux architecture and the versions involved). FWIW it works for me on sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-unknown-linux-gnu (64-bit) ... other attached packages: [1] ff_2.2-1 bit_1.1-6 If possible, try running this under valgrind (see 'Writing R Extensions') to get more info on the cause: at least run under gdb to get more precise info on what was not mapped. You don't say what the host OS of VirtualBox was. We've found I/O under VirtualBox with a x86_64 Linux host to be slow, but R to run reliably. On Wed, 2 Feb 2011, Wonsang You wrote: Dear R Helpers, I would like to report on an error in the ff package here. The ff package is an R package which enables us to store large data on disk systematically and have fast access to the database. I used the package in Linux as a guest OS of VirtualBox, and executed the following commands. library(ff) x-ff(1:5,length=5,update=TRUE,vmode=double,filename=header.ff, overwrite=TRUE) Afterwards, I got the following error message. *** caught segfault *** address 0x, cause 'memory not mapped' Traceback: 1: .Call(get_vector, .ffmode[vmode], attr(x, physical), index, nreturn, PACKAGE = ff) 2: `[.ff`(ret, 1) 3: ret[1] 4: as.vector(ret[1]) 5: identical(as.vector(initdata[1]), as.vector(ret[1])) 6: ff(1:5, length = 5, update = TRUE, vmode = double, filename = header.ff, overwrite = TRUE) Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection: Can anyone give an advice to solve the problem? Best Regards, Ryan - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/Error-of-memory-not-mapped-in-ff-Package-with-VirtualBox-tp3253856p3253856.html Sent from the R help mailing list archive at Nabble.com. __ 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. -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 [[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] Fast Two-Dimensional Optimization
Dear Dave, Thank you for your recommendation. I looked over the website of AD Model Builder for fast optimization. I want to ask you whether the software can be used in R programming as a kind of R package? Or is there any possibility that it can be jointly used with R packages? Regards, Wonsang 2010/11/25 dave fournier da...@otter-rsch.com Hi, You should be able to get the performance you want with AD Model Builder which is free software available at http://admb-project.org I can advise you if you are interested. Cheers, Dave [[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] Fast Two-Dimensional Optimization
Thank you for your kind comments. I tried different algorithms such as BFGS, CG, and so on. However, the choice of algorithms was not effective on reducing computation time. Instead, your second suggestion of coding the gradient of minimization function was a little bit successful to reduce computation time. It was twice faster than before. I appreciate you for your help. 2010/11/22 Rubén Roa r...@azti.es Did you try different algorithms? optim has Nelder-Mead (default), BFGS, simulated annealing, CG, etc. Depending on your problem, they can be much faster than the default. See ?optim and check the info for 'method' Check also optimx, a new wrapper for optim that can try out all methods. Another approach that may speed up calculations is to code for the gradients of the function that you're minimizing. Check argument 'gr' of optimx. HTH Dr. Rubén Roa-Ureta AZTI - Tecnalia / Marine Research Unit Txatxarramendi Ugartea z/g 48395 Sukarrieta (Bizkaia) SPAIN -Mensaje original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] En nombre de Wonsang You Enviado el: lunes, 22 de noviembre de 2010 16:17 Para: r-help@r-project.org Asunto: [R] Fast Two-Dimensional Optimization Dear R Helpers, I have attempted optim function to solve a two-dimensional optimization problem. It took around 25 second to complete the procedure. However, I want to reduce the computation time: less than 7 second. Is there any optimization function in R which is very rapid? Best Regards, Wonsang - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/R-Fast-Two-Dimensional-Optimizat ion-tp3053782p3053782.html Sent from the R help mailing list archive at Nabble.com. [[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. [[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] Fast Two-Dimensional Optimization
Dear R Helpers, I have attempted optim function to solve a two-dimensional optimization problem. It took around 25 second to complete the procedure. However, I want to reduce the computation time: less than 7 second. Is there any optimization function in R which is very rapid? Best Regards, Wonsang - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/R-Fast-Two-Dimensional-Optimization-tp3053782p3053782.html Sent from the R help mailing list archive at Nabble.com. [[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] Cross Spectral Analysis
Dear R helpers, I have two time series, and I want to perform the cross-spectral analysis for these time series. I would like to know whether there is any R function to generate cross-spectrum such as co-periodogram and quadrature periodogram. Can anyone give me an advice for cross spectral analysis? Thank you. Best Regards, Wonsang - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/Cross-Spectral-Analysis-tp3046999p3046999.html Sent from the R help mailing list archive at Nabble.com. [[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] How to fix error in the package 'rgenoud'
I could solve this problem by setting the boundary options as follows. par1Bnd-c(0.001,0.999) par2Bnd-c(-10,10) DomainMat-matrix(c(par1Bnd,par2Bnd), nrow = 2, ncol=2, byrow=TRUE) result-genoud(Qmin, nvars=2, starting.values=c(0.5,0), Domains=DomainMat, control=list(ndeps=c(1e-7,1e-2)), boundary.enforcement=2) To understand how to set up each option, you can refer to the links: http://sekhon.berkeley.edu/rgenoud/genoud.html http://sekhon.berkeley.edu/rgenoud/ In the above setting, Domains decides the boundary, and starting.values indicates the initial values of parameters. control is the list of control parameters in optim (For details, refer to http://sekhon.berkeley.edu/stats/html/optim.html). boundary.enforcement prevents the algorithm from going away from the boundary. On 13 October 2010 15:01, Wonsang You [via R] ml-node+2993619-1186574920-137...@n4.nabble.comml-node%2b2993619-1186574920-137...@n4.nabble.com wrote: I have to make correction in my error message which I introduced in my original message. Sorry for my mistake. Finally, I had the following error message after running the function 'genoud'. Error in optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) : non-finite finite-difference value [1] When I execute 'traceback()' to trace where the error occured, I got the following results. Unfortunately, I could not figure out what was the problem from the above information. 6: optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) 5: function (foo.vals) { ret - optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) return(c(ret$value, ret$par)) }(c(0.220878697173384, -13.3643173824871)) 4: .Call(rgenoud, as.function(fn1), new.env(), as.integer(nvars), as.integer(pop.size), as.integer(max.generations), as.integer(wait.generations), as.integer(nStartingValues), as.real(starting.values), as.vector(P), as.matrix(Domains), as.integer(max), as.integer(gradient.check), as.integer(boundary.enforcement), as.double(solution.tolerance), as.integer(BFGS), as.integer(data.type.int), as.integer(provide.seeds), as.integer(unif.seed), as.integer(int.seed), as.integer(print.level), as.integer(share.type), as.integer(instance.number), as.integer(MemoryMatrix), as.integer(debug), as.character(output.path), as.integer(output.type), as.character(project.path), as.integer(hard.generation.limit), as.function(genoud.optim.wrapper101), as.integer(lexical), as.function(fnLexicalSort), as.function(fnMemoryMatrixEvaluate), as.integer(UserGradient), as.function(gr1func), as.real(P9mix), as.integer(BFGSburnin), as.integer(transform), PACKAGE = rgenoud) 3: genoud(Qmin, nvars = 2, starting.values = InitVal, max.generations = 10, wait.generations = 3, n = n, yper = yper, pertype = pertype) at wFGN.R#75 Wonsang You Leibniz Institute for Neurobiology -- View message @ http://r.789695.n4.nabble.com/How-to-fix-error-in-the-package-rgenoud-tp2993489p2993619.html To unsubscribe from How to fix error in the package 'rgenoud', click herehttp://r.789695.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=2993489code=eW91QGlmbi1tYWdkZWJ1cmcuZGV8Mjk5MzQ4OXwxODQ5NDg1ODM2. [[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] How to fix error in the package 'rgenoud'
Dear R user fellows, I would like to ask you about the package 'rgenoud' which is a genetic optimization tool. I ran the function 'genoud' with two variables to be minimized by the following command. result-genoud(fn,nvars=2,starting.values=c(0.5,0), pop.size=1000, max.generations=10, wait.generations=3) Then, I had the following error message. Error in solve.default(Djl) : system is computationally singular: reciprocal condition number = 0 Can anyone give me some tip on how to fix the problem? Thank you for your great help in advance. Best Regards, Wonsang You - -- Wonsang You Special Lab Non-Invasive Brain Imaging Leibniz Institute for Neurobiology http://www.ifn-magdeburg.de -- View this message in context: http://r.789695.n4.nabble.com/How-to-fix-error-in-the-package-rgenoud-tp2993489p2993489.html Sent from the R help mailing list archive at Nabble.com. [[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] How to fix error in the package 'rgenoud'
I have to make correction in my error message which I introduced in my original message. Sorry for my mistake. Finally, I had the following error message after running the function ' genoud'. Error in optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) : non-finite finite-difference value [1] When I execute 'traceback()' to trace where the error occured, I got the following results. Unfortunately, I could not figure out what was the problem from the above information. 6: optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) 5: function (foo.vals) { ret - optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) return(c(ret$value, ret$par)) }(c(0.220878697173384, -13.3643173824871)) 4: .Call(rgenoud, as.function(fn1), new.env(), as.integer(nvars), as.integer(pop.size), as.integer(max.generations), as.integer(wait.generations), as.integer(nStartingValues), as.real(starting.values), as.vector(P), as.matrix(Domains), as.integer(max), as.integer(gradient.check), as.integer(boundary.enforcement), as.double(solution.tolerance), as.integer(BFGS), as.integer(data.type.int), as.integer(provide.seeds), as.integer(unif.seed), as.integer(int.seed), as.integer(print.level), as.integer(share.type), as.integer(instance.number), as.integer(MemoryMatrix), as.integer(debug), as.character(output.path), as.integer(output.type), as.character(project.path), as.integer(hard.generation.limit), as.function(genoud.optim.wrapper101), as.integer(lexical), as.function(fnLexicalSort), as.function(fnMemoryMatrixEvaluate), as.integer(UserGradient), as.function(gr1func), as.real(P9mix), as.integer(BFGSburnin), as.integer(transform), PACKAGE = rgenoud) 3: genoud(Qmin, nvars = 2, starting.values = InitVal, max.generations = 10, wait.generations = 3, n = n, yper = yper, pertype = pertype) at wFGN.R#75 On 13 October 2010 13:03, Wonsang You y...@ifn-magdeburg.de wrote: Dear R user fellows, I would like to ask you about the package 'rgenoud' which is a genetic optimization tool. I ran the function 'genoud' with two variables to be minimized by the following command. result-genoud(fn,nvars=2,starting.values=c(0.5,0), pop.size=1000, max.generations=10, wait.generations=3) Then, I had the following error message. Error in solve.default(Djl) : system is computationally singular: reciprocal condition number = 0 Can anyone give me some tip on how to fix the problem? Thank you for your great help in advance. Best Regards, Wonsang You - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/Re-How-to-fix-error-in-the-package-rgenoud-tp2993614p2993614.html Sent from the R help mailing list archive at Nabble.com. [[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] How to fix error in the package 'rgenoud'
I have to make correction in my error message which I introduced in my original message. Sorry for my mistake. Finally, I had the following error message after running the function 'genoud'. Error in optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) : non-finite finite-difference value [1] When I execute 'traceback()' to trace where the error occured, I got the following results. Unfortunately, I could not figure out what was the problem from the above information. 6: optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) 5: function (foo.vals) { ret - optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control = control) return(c(ret$value, ret$par)) }(c(0.220878697173384, -13.3643173824871)) 4: .Call(rgenoud, as.function(fn1), new.env(), as.integer(nvars), as.integer(pop.size), as.integer(max.generations), as.integer(wait.generations), as.integer(nStartingValues), as.real(starting.values), as.vector(P), as.matrix(Domains), as.integer(max), as.integer(gradient.check), as.integer(boundary.enforcement), as.double(solution.tolerance), as.integer(BFGS), as.integer(data.type.int), as.integer(provide.seeds), as.integer(unif.seed), as.integer(int.seed), as.integer(print.level), as.integer(share.type), as.integer(instance.number), as.integer(MemoryMatrix), as.integer(debug), as.character(output.path), as.integer(output.type), as.character(project.path), as.integer(hard.generation.limit), as.function(genoud.optim.wrapper101), as.integer(lexical), as.function(fnLexicalSort), as.function(fnMemoryMatrixEvaluate), as.integer(UserGradient), as.function(gr1func), as.real(P9mix), as.integer(BFGSburnin), as.integer(transform), PACKAGE = rgenoud) 3: genoud(Qmin, nvars = 2, starting.values = InitVal, max.generations = 10, wait.generations = 3, n = n, yper = yper, pertype = pertype) at wFGN.R#75 - Wonsang You Leibniz Institute for Neurobiology -- View this message in context: http://r.789695.n4.nabble.com/How-to-fix-error-in-the-package-rgenoud-tp2993489p2993619.html Sent from the R help mailing list archive at Nabble.com. __ 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] How to combine matrix and vector
Dear fellows, I am a novice in R. I would like to combine a matrix and a vector. Assume that we have the matrix a and the vector b with same length of column. a-matrix(seq(1:10),nrow=2,ncol=5,byrow=TRUE) a= 12345 6789 10 b-t(c(11,12,13,14,15)) b= 11 12 13 14 15 Then, I want to combine a and b as follows. c= 12345 6789 10 11 12 13 14 15 If you teach me to easily combine the matrix and the vector, I will greatly appreciate you. Thank you. Regards, Wonsang - -- Wonsang You Special Lab Non-Invasive Brain Imaging Leibniz Institute for Neurobiology http://www.ifn-magdeburg.de -- View this message in context: http://r.789695.n4.nabble.com/How-to-combine-matrix-and-vector-tp2541797p2541797.html Sent from the R help mailing list archive at Nabble.com. [[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] How to uncompress a gz file in R
Dear Henrik and Steven, Thank you for your kind help and guidance even though it is a basic question. I misunderstood that gunzip is a part of not R.utils but utils. I could find out the function in R.utils. Then, it was successful to decompress any gz file as follows. library(R.utils) gunzip(foo.gz) Best Regards, Wonsang [[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] How to combine matrix and vector
Thank you so much for your help. It was successful to combine matrix and vector by using rbind as follows. a-matrix(seq(1:10),nrow=2,ncol=5,byrow=TRUE) a [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]6789 10 b-t(c(11,12,13,14,15)) b [,1] [,2] [,3] [,4] [,5] [1,] 11 12 13 14 15 rbind(a,b) [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]6789 10 [3,] 11 12 13 14 15 - -- Wonsang You Special Lab Non-Invasive Brain Imaging Leibniz Institute for Neurobiology http://www.ifn-magdeburg.de -- View this message in context: http://r.789695.n4.nabble.com/How-to-combine-matrix-and-vector-tp2541797p2542362.html Sent from the R help mailing list archive at Nabble.com. __ 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] How to uncompress a gz file in R
Dear Henrik, Thank you so much for your kind help. Unfortunately, I could not find out any function such as 'gunzip' in R.utils package. Instead, I could be successful by using the following command. system(gunzip filename) On the other hand, the function 'gzfile' supports the compression as gz format, but I still do not know how to decompress gz file by using the function 'gzfile'. Best Regards, Wonsang On 14 September 2010 15:23, Henrik Bengtsson h...@stat.berkeley.edu wrote: To uncompress an *.gz file into another file on disk, see also ?gunzip in the R.utils package. /Henrik 2010/9/14 Uwe Ligges lig...@statistik.tu-dortmund.de: See ?gzfile Uwe Ligges On 14.09.2010 11:02, Wonsang You wrote: Dear Fellows, I would like to know how to uncompress a gz file at the R console. I could not find out any help from the R-help archive. Thanks for your great help. Best Regards, Wonsang You - -- Wonsang You Special Lab Non-Invasive Brain Imaging Leibniz Institute for Neurobiology http://www.ifn-magdeburg.de __ 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. [[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] How to uncompress a gz file in R
Dear Fellows, I would like to know how to uncompress a gz file at the R console. I could not find out any help from the R-help archive. Thanks for your great help. Best Regards, Wonsang You - -- Wonsang You Special Lab Non-Invasive Brain Imaging Leibniz Institute for Neurobiology http://www.ifn-magdeburg.de -- View this message in context: http://r.789695.n4.nabble.com/How-to-uncompress-a-gz-file-in-R-tp2538669p2538669.html Sent from the R help mailing list archive at Nabble.com. [[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] How to Adaptively Set Up the Coordinate Range of Multiple Graphs in One Figure
Hi, R-Helpers, I would like to ask about multiple graphs in one figure. I tried to execute the following codes. xlim - c(1,100) ylim - c(1,4) plot(NA, xlim=xlim, ylim=ylim) x - c(1:100) for(j in seq(1,10,by=1)) { y - j*x^2+log(j) lines(x, y) } In the above codes, I had to arbitrarily set up the coordinate range of the figure in advance before calculating the values y. (seexlim and ylim) In results, the figure did not contain all data since most of data were outside the predefined range. I am wondering about how to control xlim and ylim adaptive to the real range of data, in order to include all data in the figure. Thank you for your great help and contribution. Best Regards, Stephen You - -- Wonsang You Special Lab Non-Invasive Brain Imaging Leibniz Institute for Neurobiology http://www.ifn-magdeburg.de -- View this message in context: http://r.789695.n4.nabble.com/How-to-Adaptively-Set-Up-the-Coordinate-Range-of-Multiple-Graphs-in-One-Figure-tp2401337p2401337.html Sent from the R help mailing list archive at Nabble.com. [[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.