Re: [R] (Fisher) Randomization Test for Matched Pairs: Permutation Data Setup Based on Signs

2012-03-11 Thread Petr Savicky
On Thu, Mar 08, 2012 at 09:49:20PM -0800, Ghandalf wrote: Hi, I am currently attempting to write a small program for a randomization test (based on rank/combination) for matched pairs. If you will please allow me to introduce you to some background information regarding the test prior to my

Re: [R] (Fisher) Randomization Test for Matched Pairs: Permutation Data Setup Based on Signs

2012-03-11 Thread peter dalgaard
On Mar 11, 2012, at 03:17 , R. Michael Weylandt wrote: In general, I *think* this is a hard problem (it sounds knapsack-ish) but since you are on small enough data sets, that's probably not so important: if I understand you right, this little function will help you. plusminus -

Re: [R] How do I do a pretty scatter plot using ggplot2?

2012-03-11 Thread Jim Lemon
On 03/10/2012 11:37 AM, Michael wrote: Hi all, I am trying hard to do the following and have already spent a few hours in vain: I wanted to do the scatter plot. But given the high dispersion on those dots, I would like to bin the x-axis and then for each bin of the x-axis, plot the quantiles

[R] Interfacing between Optimization Software and R

2012-03-11 Thread Renger van Nieuwkoop
Dear all I was wondering, if there are reasons for R-Users to use (commercial) solver packages like GAMS, AMPL, Matlab, etc. These packages can solve all kind of mathematical optimization problems like (non-) linear problems, mixed complementarity problems, etc. Why I want to know? GAMS

[R] Matrix negative fraction power

2012-03-11 Thread Ebrahim Jahanshiri
Dear list, I understand that to raise matrix A to power (-1/2) we should use something like this: eigen(A)$vectors%*%diag(1/sqrt(eigen(A)$values))%*%t(eigen(A)$vectors) [from previous discussions: http://r.789695.n4.nabble.com/matrix-power-td900335.html] But this will only do it for negative

Re: [R] Interfacing between Optimization Software and R

2012-03-11 Thread Prof Brian Ripley
You missed a lot of indications, most prominently the task view http://cran.r-project.org/web/views/Optimization.html On 11/03/2012 07:18, Renger van Nieuwkoop wrote: Dear all I was wondering, if there are reasons for R-Users to use (commercial) solver packages like GAMS, AMPL, Matlab, etc.

Re: [R] [R-sig-eco] Landscape ecology in R

2012-03-11 Thread Sarah Goslee
Hi Manuel, I've taken the liberty of adding the r-help list back to this email, even though you sent your reply just to me, so that others may contribute. On Fri, Mar 9, 2012 at 6:27 PM, Manuel Spínola mspinol...@gmail.com wrote: Thank you Sarah, I am thinking more on habitat mapping and

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-11 Thread Hans Ekbrand
On Sat, Mar 10, 2012 at 04:01:21PM -0800, casperyc wrote: Sorry if I wasn't stating what I really wanted or it was a bit confusing. Basically, there are MANY datasets to run suing the same function I have written a function to analyze it and returns a LIST of useful out put in the variable

Re: [R] too many open devices

2012-03-11 Thread harold kincaid
Many thanks for your answer. I am using someone else's code that has worked fine for some time and don't know much about R graphics. Windows are being opened, the clutter is definitely there, and it looks like dev.off is not being used. So at least it probably is not a stupid attack on my part. So

Re: [R] Matrix negative fraction power

2012-03-11 Thread Peter Langfelder
On Sun, Mar 11, 2012 at 1:46 AM, Ebrahim Jahanshiri e.jahansh...@gmail.com wrote: Dear list, I understand that to raise matrix A to power (-1/2) we should use something like this: eigen(A)$vectors%*%diag(1/sqrt(eigen(A)$values))%*%t(eigen(A)$vectors) [from previous discussions:

Re: [R] Matrix negative fraction power

2012-03-11 Thread Joshua Wiley
On Sun, Mar 11, 2012 at 8:56 AM, Peter Langfelder peter.langfel...@gmail.com wrote: On Sun, Mar 11, 2012 at 1:46 AM, Ebrahim Jahanshiri e.jahansh...@gmail.com wrote: Dear list, I understand that to raise matrix A to power (-1/2) we should use something like this:

[R] Efficient access to elements of a list of lists

2012-03-11 Thread Benilton Carvalho
Hi, I have a long list of lists from which I want to efficiently extract and rbind elements. So I'm using the approach below: f - function(i){ out - replicate(5, list(matrix(rnorm(80), nc=20))) names(out) - letters[1:5] out } set.seed(1) lst - lapply(1:1.5e6, f) (t0 -

[R] Fwd: Matrix negative fraction power

2012-03-11 Thread Ebrahim Jahanshiri
Thank you very much Peter, Indeed this should be left to the reader/practitioner. But I think -at least for the sake of comparison with matlab- we could have it in the core R. I would definitely try to learn more about R and implement it later. Cheers, Ebrahim On Sun, Mar 11, 2012 at 11:56 PM,

Re: [R] Matrix negative fraction power

2012-03-11 Thread Spencer Graves
If my memory is correct, the archives of this list contains several discussions of round off error problems associated with different methods for computing things like this. The Matrix package (part of the base distribution) contains a function expm, whose help file says, The expm

Re: [R] Matrix negative fraction power

2012-03-11 Thread Berend Hasselman
On 11-03-2012, at 17:52, Spencer Graves wrote: If my memory is correct, the archives of this list contains several discussions of round off error problems associated with different methods for computing things like this. The Matrix package (part of the base distribution) contains a

Re: [R] Matrix negative fraction power

2012-03-11 Thread Berend Hasselman
On 11-03-2012, at 18:18, Berend Hasselman wrote: On 11-03-2012, at 17:52, Spencer Graves wrote: If my memory is correct, the archives of this list contains several discussions of round off error problems associated with different methods for computing things like this. The Matrix

Re: [R] function input as variable name (deparse/quote/paste) ??

2012-03-11 Thread casperyc
Thank you everyone for your reply. Like I said in my original post, this is just a demonstrative example of my 'big' self written script. My 'big' function take several inputs, of which the first 1 is the dataset and returns a LIST variable 'res-list()' to the workspace with many information.

Re: [R] Efficient access to elements of a list of lists

2012-03-11 Thread Henrik Bengtsson
On Sun, Mar 11, 2012 at 9:18 AM, Benilton Carvalho beniltoncarva...@gmail.com wrote: Hi, I have a long list of lists from which I want to efficiently extract and rbind elements. So I'm using the approach below: f - function(i){    out - replicate(5, list(matrix(rnorm(80), nc=20)))    

Re: [R] Efficient access to elements of a list of lists

2012-03-11 Thread Benilton Carvalho
Thanks Henrik!!! Hope to pay your beer soon. :) b __ 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,

Re: [R] Warnings when plotting after x11() in R 2.14.2

2012-03-11 Thread Uwe Ligges
On 08.03.2012 21:03, Mark Seeto wrote: Dear R-help, I recently upgraded from R 2.13.1 to R 2.14.2 and now get warning messages when plotting after using x11(). Example: plot(rnorm(10))### no warnings x11(); plot(rnorm(10)) Warning messages: 1: In axis(side = side, at = at, labels =

[R] extracting data from unstructured (text?) file

2012-03-11 Thread frauke
Dear R community, I have the following problem I hoped you could help me with. My data is save in thousand of files with a weird extension containing for numbers and a z. For example *.1405z. With list.files I managed to load this data into R. It looks like this (the row numbers are not in the

Re: [R] extracting data from unstructured (text?) file

2012-03-11 Thread jim holtman
Can you at least provide a subset of 2 files so we can see how the data is really stored in the file and what the separators are between the 'columns' of data. Also how do you determine where the data actually starts for the rows that you want to pull off. This will aid in determining how to

Re: [R] extracting data from unstructured (text?) file

2012-03-11 Thread Vijaya Parthiban
Hi Frauke, Try unix commands with R's system() function. Example: Let's say you have a matrix like this in the file (note: the first element is missing) called hello.txt 10 100 2 20 200 3 30 300 4 40 400 5 50 500 You can try something like: hello = system(cut -f1 hello.txt, intern=T) VP. On

[R] Problems when building a package for Windows 64

2012-03-11 Thread Eduardo Mendes
Hello I have recently installed R 2.14.2 on a brand new pc running Windows 64. One of things I would like to do is to recompile my R package (with C and fortran source codes) for this new environment (it works on a mac and on a linux box). To this end, I had rtools 2.14 downloaded and installed

Re: [R] Problems when building a package for Windows 64

2012-03-11 Thread Prof Brian Ripley
On 11/03/2012 19:43, Eduardo Mendes wrote: Hello I have recently installed R 2.14.2 on a brand new pc running Windows 64. One of things I would like to do is to recompile my R package (with C and fortran source codes) for this new environment (it works on a mac and on a linux box). To this

Re: [R] extracting data from unstructured (text?) file

2012-03-11 Thread frauke
Thank you for the quick reply! I have attached two files. http://r.789695.n4.nabble.com/file/n4464511/sample1.1339z sample1.1339z http://r.789695.n4.nabble.com/file/n4464511/sample2.1949z sample2.1949z -- View this message in context:

Re: [R] Problems when building a package for Windows 64

2012-03-11 Thread Eduardo Mendes
Dear Prof. Ripley Many thanks. rtools 2.15 did the job. One note if I may - In the rtools site one reads rtools215.exe - r2.14.1 to R 2.15.x No rtoosl214.exe - r 2.13.x or R.2.14.x yes which can mislead the reader. 2.14.x could mean 2.14.2 and no could mean that rtools-2.15 is not read for

Re: [R] Siegel-Tukey test for equal variability (code)

2012-03-11 Thread Tal Galili
Update: The siegel Tukey code is now fixed (both on the github page, and the blog's post): https://github.com/talgalili/R-code-snippets/blob/master/siegel.tukey.r http://www.r-statistics.com/2010/02/siegel-tukey-a-non-parametric-test-for-equality-in-variability-r-code/ Best, Tal On Sat, Mar

Re: [R] extracting data from unstructured (text?) file

2012-03-11 Thread jim holtman
Here is one way assuming the data start after QPF FORECAST: setwd('/temp') # where the data is files - c('sample1.htm', 'sample2.htm') # files to read # assumes 4 columns of data fields - list(c(19, 24), c(30, 35), c(41, 46), c(52, 57)) #columns of data results - lapply(files,

[R] CRAN (and crantastic) updates this week

2012-03-11 Thread Crantastic
CRAN (and crantastic) updates this week New packages * EffectStars (1.0) Maintainer: Unknown Author(s): Gunther Schauberger License: GPL-2 http://crantastic.org/packages/EffectStars The package provides functions to visualize regression models with categorical response.

Re: [R] Which non-parametric regression would allow fitting this type of data? (example given).

2012-03-11 Thread Emmanuel Levy
Hello Bert, Thanks so much for these suggestions. They led me to the package LPCM, which I found worked best with minimum tuning. lpc1 = lpc(cbind(X,Y), scaled=TRUE, h=c(0.05,0.05)) plot(lpc1) ... et voila! All the best, Emmanuel On 11 March 2012 00:37, Bert Gunter gunter.ber...@gene.com

Re: [R] How do I do a pretty scatter plot using ggplot2?

2012-03-11 Thread Michael
Could you please show me an example for my two cases? Thanks a lot! On Sun, Mar 11, 2012 at 3:55 AM, Jim Lemon j...@bitwrit.com.au wrote: On 03/10/2012 11:37 AM, Michael wrote: Hi all, I am trying hard to do the following and have already spent a few hours in vain: I wanted to do the

Re: [R] extracting data from unstructured (text?) file

2012-03-11 Thread frauke
Wow Jim, this is much more than I expected. Thank you!! It took me a while to figure out what exactly you are doing in that code. But I think I understand and it definitely runs. May I ask you two follow up questions? First, some of my files have data from two or more cities in them. So I have

[R] specify GARCH model, using garchFit()

2012-03-11 Thread Ashley Bonner
Hello, I’ve fitted a Garch(2,1) model with function 'garchFit()' from the package 'fGarch': m1 - garchFit(formula = ~garch(2,1),data = X,trace = F) * See 'summary(m1)' OUTPUT BELOW * PROBLEM: My alpha1 term is not significant and I would like to make a NEW model, say m2, that does not contain

[R] to Michael ... Re: How do I do a pretty scatter plot using ggplot2?

2012-03-11 Thread Michael
Hi Michael, I am trying the solution you've suggested below: DAT - data.frame(x = runif(1000, 0, 20), y = rnorm(1000)) DAT$xbin - with(DAT, cut(x, seq(0, 20, 2))) p - ggplot(DAT, aes(x = x, y = y)) + geom_point(alpha = 0.2) + stat_quantile(aes(colour = ..quantile..), quantiles = seq(0.05, 0.95,

Re: [R] to Michael ... Re: How do I do a pretty scatter plot using ggplot2?

2012-03-11 Thread Michael
And also, no matter how I changed the quantiles = seq(0.05, 0.95, by=0.05)) line, the number of lines in each bin and the number of legends on the right side of the each plot are different... What's the catch? Am I missing something here? I thought the number of quantile lines and the number of

[R] Idea/package to linearize a curve along the diagonal?

2012-03-11 Thread Emmanuel Levy
Hi, I am trying to normalize some data. First I fitted a principal curve (using the LCPM package), but now I would like to apply a transformation so that the curve becomes a straight diagonal line on the plot. The data used to fit the curve would then be normalized by applying the same

[R] SEM eigen value error 0 X 0 matrix

2012-03-11 Thread jahughes81
Using R-studio, I am trying to run a structural equation model and I am running into problems with testing my primary model. Once I specify everything and try to run it I get this error: Error in eigen(S, symmetric = TRUE, only.values = TRUE) : 0 x 0 matrix And when I look at the object for my

Re: [R] Idea/package to linearize a curve along the diagonal?

2012-03-11 Thread Jeff Newmiller
Aren't you just reinventing the inverse of a function? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

[R] ggplot2: coord_polar

2012-03-11 Thread Athula Herath
Hello HelpeRs, The last print statement in the code segment below results in : Error in data$x[data$x == -Inf] - range$x.range[1] : replacement has length zero R version 2.14.1 Patched (2011-12-23 r57982) ggplot2: version 0.90 OS : Linux (64bit) Any thoughts? Many Thanks, A. ##

[R] How to plot diagonal line at any coordinate range in R

2012-03-11 Thread Gundala Viswanath
Dear expert How can we plot diagonal across (from bottom-left-hand corner to top right-hand corner), at any given coordinate range For example plot(c(-2,3), c(-1,5), type = n, xlab=x, ylab=y, asp = 1) or plot(c(0,1000), c(0,334), type = n, xlab=x, ylab=y, asp = 1) I tried abline with the

Re: [R] How to plot diagonal line at any coordinate range in R

2012-03-11 Thread Jeff Newmiller
Your requirement that the line go from bottom-left to top-right regardless of the coordinates is inconsistent with a slope of 1. Are you sure that is your requirement? --- Jeff NewmillerThe .

[R] Re : How to plot diagonal line at any coordinate range in R

2012-03-11 Thread Pascal Oettli
Hi  G.V. Does it fit to your request? plot(c(-2,3), c(-1,5), type = n, xlab=x, ylab=y, asp = 1) dg - par(usr) segments(dg[1],dg[3],dg[2],dg[4], col='red') Regards, Pascal - Mail original - De : Gundala Viswanath gunda...@gmail.com À : r-h...@stat.math.ethz.ch Cc : Envoyé le : Lundi