[R] help with function "system" and MS-DOS command TYPE

2007-01-30 Thread Chen, Xiao
Greetings - I have a quick question that I hope someone will have a quick answer. I have tried to use the R function "system" with the MS-DOS command "type" to display the full content of a text file. But it always returns with a message saying the text file is not found. I could accomplish the sa

Re: [R] Bootstrapping Confidence Intervals for Medians

2007-01-30 Thread Tim Hesterberg
This is in followup to an earlier message about bootstrap confidence intervals for the difference in two medians. I'll touch on three topics: * bootstrap theory for one vs two samples * special case of median * bootstrap small samples ONE VS TWO SAMPLES Brian Ripley wrote (the complete posting

Re: [R] Need to fit a regression line using orthogonal residuals

2007-01-30 Thread Henrik Bengtsson
The iwpca() in Bioconductor package aroma.light takes a matrix of column vectors and "fits an R-dimensional hyperplane using iterative re-weighted PCA". From ?iwpca.matrix: "Arguments: X N-times-K matrix where N is the number of observations and K is the number of dimensions. Details: This

Re: [R] SparseM and Stepwise Problem

2007-01-30 Thread roger koenker
One simple possibility -- if you can generate the X matrix in dense form is the coercion X <- as.matrix.csr(X) Unfortunately, there is no current way to go from a formula to a sparse X matrix without passing through a dense version of X first. Otherwise you need to use new() to

Re: [R] Install RMySQL with R 2.4.0

2007-01-30 Thread Joe W. Byers
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 th

Re: [R] Need to fit a regression line using orthogonal residuals

2007-01-30 Thread Bill.Venables
Jonathon Kopecky asks: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathon Kopecky Sent: Tuesday, 30 January 2007 5:52 AM To: r-help@stat.math.ethz.ch Subject: [R] Need to fit a regression line using orthogonal residuals I'm trying to fit a simple li

Re: [R] regexpr and parsing question

2007-01-30 Thread Gabor Grothendieck
And here is an alternative to the regular expressions (although again I don't think you really need any of this): > capture.output(dput(strsplit("col1 col2 col3", " ")[[1]])) [1] "c(\"col1\", \"col2\", \"col3\")" On 1/30/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Both spaces and tabs are

[R] lme : Error in y[revOrder] - Fitted : non-conformable arrays

2007-01-30 Thread Andrew R. Kniss
Greetings R-helpers, I am attempting to fit an lme() while specifying a correlation structure, but I'm getting into trouble long before I get to that point. I am receiving the error: Error in y[revOrder] - Fitted : non-conformable arrays It doesn't seem to matter how simple or complex the model I

[R] SparseM and Stepwise Problem

2007-01-30 Thread davidkat
I'm trying to use stepAIC on sparse matrices, and I need some help. The documentation for slm.fit suggests: slm.fit and slm.wfit call slm.fit.csr to do Cholesky decomposition and then backsolve to obtain the least squares estimated coefficients. These functions can be called directly if the user

Re: [R] regexpr and parsing question

2007-01-30 Thread Marc Schwartz
On Tue, 2007-01-30 at 17:23 -0500, Kimpel, Mark William wrote: > The main problem I am trying to solve it this: > > I am importing a tab delimited file whose first line contains only one > column, which is a descriptor of the form "col_1 col_2 col_3", i.e. the > colnames are not tab delineated but

Re: [R] regexpr and parsing question

2007-01-30 Thread Gabor Grothendieck
Both spaces and tabs are whitespace so this should be good enough (unless you can have empty fields): read.table("myfile.dat", header = TRUE) See the sep= argument in ?read.table . Although I don't think you really need this, here are some regular expressions for processing a header into the for

Re: [R] R packages

2007-01-30 Thread Achim Zeileis
Also have a look at the excellent Bayesian CRAN task view http://CRAN.R-project.org/src/contrib/Views/Bayesian.html Z On Tue, 30 Jan 2007, Giovanni Petris wrote: > Have you tried a search of CRAN? Seaching r-help archives may result > in useful information as well. > > As formulated, the questi

Re: [R] Difficulty with compiling R-2.4.1 on solaris 10

2007-01-30 Thread Peter Dalgaard
Andrew John Duba wrote: > I am trying to compile R-2.4.1 in 64-bit on Solaris 10 running on AMD > hardware. I am trying to do this with Sun Studio 11. > > Oi!! We heard you the first three times. And you are still on the wrong list (this belongs on r-devel.) Spamming the list will only annoy

Re: [R] silent loading of packages

2007-01-30 Thread Prof Brian Ripley
It depends on the 'message'. In this case > library(VGAM, warn.conflicts=FALSE) > suppressMessages(library(VGAM)) both work. (How did you manage to miss the first?) In general, it depends on whether the 'message' is a message in the sense of message() or produced some other way. sink() would

[R] regexpr and parsing question

2007-01-30 Thread Kimpel, Mark William
The main problem I am trying to solve it this: I am importing a tab delimited file whose first line contains only one column, which is a descriptor of the form "col_1 col_2 col_3", i.e. the colnames are not tab delineated but are separated by whitespace. I would like to parse this first line and m

Re: [R] Solaris 10 compilation issue

2007-01-30 Thread Prof Brian Ripley
We really don't want this three times! It looks like the archives (.a) you are making are broken, possibly because your path does not include the approriate Solaris tools such as ranlib. To take the first example, cg_ should be in src/appl/libappl.a. There is a pre-compiled version of R-2.4.1

Re: [R] R packages

2007-01-30 Thread Giovanni Petris
Have you tried a search of CRAN? Seaching r-help archives may result in useful information as well. As formulated, the questions are difficult to answer. There are packages that use MCMC, Gibbs Sampling, Metropolis Hastings for specific classes of models. Best, Giovanni Petris > Date: Tue, 30

[R] Difficulty with compiling R-2.4.1 on solaris 10

2007-01-30 Thread Andrew John Duba
I am trying to compile R-2.4.1 in 64-bit on Solaris 10 running on AMD hardware. I am trying to do this with Sun Studio 11. My config.site looks like this: #! /bin/sh AR="/usr/ccs/bin/ar" TEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/tex" LATEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/latex" PD

Re: [R] change plotting symbol for groups in trellis graph

2007-01-30 Thread Gabor Grothendieck
Try this: library(lattice) dotplot(variety ~ yield | site, data = barley, groups = year, auto.key = list(space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL, par.settings = list(superpose.symbol = list(

[R] Issue with compiling R on solaris 10

2007-01-30 Thread Andrew John Duba
I am trying to compile R-2.4.1 in 64-bit on Solaris 10 running on AMD hardware. I am trying to do this with Sun Studio 11. My config.site looks like this: #! /bin/sh AR="/usr/ccs/bin/ar" TEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/tex" LATEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/latex" PD

[R] R Compiling issue

2007-01-30 Thread andrew duba
I am trying to compile R-2.4.1 in 64-bit on Solaris 10 running on AMD hardware. I am trying to do this with Sun Studio 11. My config.site looks like this: #! /bin/sh AR="/usr/ccs/bin/ar" TEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/tex" LATEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/latex"

[R] Solaris 10 compilation issue

2007-01-30 Thread Andrew_Duba
I am trying to compile R-2.4.1 in 64-bit on Solaris 10 running on AMD hardware. I am trying to do this with Sun Studio 11. My config.site looks like this: #! /bin/sh AR="/usr/ccs/bin/ar" TEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/tex" LATEX="/usr/local/teTeX/bin/i386-pc-solaris2.10/latex" P

Re: [R] Simple Date problems with cbind

2007-01-30 Thread Marc Schwartz
On Tue, 2007-01-30 at 15:27 -0500, John Kane wrote: > I am clearly misunderstanding something about dates > and my reading of the help and RSiteSearch have not > turned up anything. > > I have a variable of class "Date" and I want to add > include it in a data.frame. However when do a cbind > the

[R] change plotting symbol for groups in trellis graph

2007-01-30 Thread Tom Boonen
Hi, how can I change the plotting symbol for the groups in a trellis panel dotplot. My graph is similar to: library(trellis) dotplot(variety ~ yield | site, data = barley, groups = year, key = simpleKey(levels(barley$year), space = "right"), xlab = "Barley Yield (bushel

Re: [R] Simple Date problems with cbind

2007-01-30 Thread Tony Plate
> It is probably something blindingly simple but can > anyone suggest something? You need to use the format code "%Y" for 4-digits years. You need to create a data frame using 'data.frame()' (cbind() creates a matrix when given just vectors). > as.Date(c("2005/01/24" ,"2006/01/23" ,"2006/01/23

Re: [R] silent loading of packages

2007-01-30 Thread Gabor Grothendieck
Try this. We first load the dependent packages to avoid the loading message: library(splines) library(stats4) library(VGAM, warn.conflicts = FALSE) On 1/30/07, johan Faux <[EMAIL PROTECTED]> wrote: > I would like to turn off all the messages during > library(aPackage) or > require(aPackage) > >

Re: [R] complex samping designs

2007-01-30 Thread David Kaplan
This is a lifesaver. Thanks!!! David === David Kaplan, Ph.D. Professor Department of Educational Psychology University of Wisconsin - Madison Educational Sciences, Room, 1061 1025 W. Johnson Street Madison, WI 53706 email:

[R] Simple Date problems with cbind

2007-01-30 Thread John Kane
I am clearly misunderstanding something about dates and my reading of the help and RSiteSearch have not turned up anything. I have a variable of class "Date" and I want to add include it in a data.frame. However when do a cbind the date var is coerced into a numeric. However when I tried to cre

[R] silent loading of packages

2007-01-30 Thread johan Faux
I would like to turn off all the messages during library(aPackage) or require(aPackage) I tried different commands: invisible, capture.output, sink but none of them is working. For example, loading VGAM, gives a lot of unnecessary messages: > library(VGAM) Attaching package: 'VGAM'

Re: [R] complex samping designs

2007-01-30 Thread Chuck Cleland
David Kaplan wrote: > Hi all, > > Is there a package available in R that can be used in conjunction with > statistical procedures to weight observations for unequal probability of > selection? http://cran.r-project.org/doc/packages/survey.pdf RSiteSearch("complex survey") > Thanks in advance.

[R] complex samping designs

2007-01-30 Thread David Kaplan
Hi all, Is there a package available in R that can be used in conjunction with statistical procedures to weight observations for unequal probability of selection? Thanks in advance. David -- === David Kaplan, Ph.D. Prof

Re: [R] lattice: how to get 'lattice.theme'

2007-01-30 Thread Deepayan Sarkar
On 1/30/07, Benjamin Tyner <[EMAIL PROTECTED]> wrote: > Thanks...what I really want is to be able to access the value of the > 'color' argument the user gave in their call to trellis.device(). I > mistakenly assumed it would be stored in 'lattice.theme' but this does > not seem to be the case? It

Re: [R] Multiple comparisons when interacction

2007-01-30 Thread Jorge Lampurlanes Castel
Yes, it can be done. It is not currently easy because multcomp doesn't have the syntax yet. Making this easy is on Torsten's to-do list for the multcomp package. See the MMC.WoodEnergy example in the HH package. The current version on CRAN is HH_1.17. Please see the discussion of this example

Re: [R] lattice: two grouping variables, one controls 'col', the other 'pch'

2007-01-30 Thread hadley wickham
On 1/28/07, Benjamin Tyner <[EMAIL PROTECTED]> wrote: > Say I have > > library(lattice) > > x<-runif(256) > y<-runif(256) > f<-gl(16,16) > g1<-rep(1:4,each=64) > g2<-rep(1:4,times=64) > > plot<-xyplot(y~x|f, > groups=g1, > pch=as.character(1:4), > panel=functi

Re: [R] comparing random forests and classification trees

2007-01-30 Thread Darin A. England
Amy, I have also had this issue with randomForest, that is, you lose the ability to explain the classifier in a simple way to non-specialists (everyone can understand the single decision tree.) As far as comparing the accuracy of the two, I think that you are correct in comparing them by the actua

Re: [R] Multiple comparisons when interacction

2007-01-30 Thread Jorge Lampurlanes Castel
As I understand from the WoodEnergy example in package HH, You are proposing to compute a separate lm for each level of YEAR factor to compare TIL means. This is the way I used to do this kind of analysis. But now, it is also possible, with PROC GLM, to adjust only the general model (variable ~ BL

Re: [R] spss.get. Warning with SPSS 14 dataset

2007-01-30 Thread Muenchen, Robert A (Bob)
Here's a warning about that: http://tolstoy.newcastle.edu.au/R/help/04/12/8827.html Bob = Bob Muenchen (pronounced Min'-chen), Manager Statistical Consulting Center U of TN Office of Information Technology 200 Stokely Management C

Re: [R] lattice: how to get 'lattice.theme'

2007-01-30 Thread Gabor Grothendieck
I think there is an entry for each device in lattice.theme and the color would be in the device's entry. Check the source of trellis.device to be sure. On 1/30/07, Benjamin Tyner <[EMAIL PROTECTED]> wrote: > Thanks...what I really want is to be able to access the value of the > 'color' argument t

Re: [R] lattice: how to get 'lattice.theme'

2007-01-30 Thread Benjamin Tyner
Thanks...what I really want is to be able to access the value of the 'color' argument the user gave in their call to trellis.device(). I mistakenly assumed it would be stored in 'lattice.theme' but this does not seem to be the case? Ben __ R-help@sta

Re: [R] lattice: how to get 'lattice.theme'

2007-01-30 Thread Gabor Grothendieck
Try: lattice.theme <- get("lattice.theme", envir = lattice:::.LatticeEnv) On 1/30/07, Benjamin Tyner <[EMAIL PROTECTED]> wrote: > I'm using lattice 0.14. As of version 0.5 the Changes says there is a > global list called 'lattice.theme'. How can I access this? I have tried > many ways, includin

[R] lattice: how to get 'lattice.theme'

2007-01-30 Thread Benjamin Tyner
I'm using lattice 0.14. As of version 0.5 the Changes says there is a global list called 'lattice.theme'. How can I access this? I have tried many ways, including options(lattice.theme) lattice.getOption("lattice.theme") get("lattice.theme", envir = .LatticeEnv) getFromNamespace("lattice.theme",

Re: [R] jump in sequence

2007-01-30 Thread Ben Fairbank
Or perhaps rep(4:6,3)+9*rep(0:2,rep(3,3)) with changes as necessary for longer sequences Ben Fairbank -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian DUSA Sent: Tuesday, January 30, 2007 8:29 AM To: r-help@stat.math.ethz.ch Subject: [R] jump in

Re: [R] lattice: two grouping variables, one controls 'col', the other 'pch'

2007-01-30 Thread Benjamin Tyner
Thanks, that does the trick. I guess with two grouping variables it is best to bypass 'groups' entirely.' Ben Gabor Grothendieck wrote: > Try: > > xyplot(y ~ x | f, pch = g1, col = g2, panel = function(x, y, > subscripts, ..., pch, col) > panel.xyplot(x, y, ..., col = col[subscripts], pch =

[R] Step-by-step guide for using C/C++ in R; WAS: [Rd] Speed of for loops

2007-01-30 Thread Oleg Sklyar
I know this should not go to [Rd], but the original post was there and the replies as well. Thank you all who expressed interest in the "Step-by-step guide for using C/C++ in R"! Answering some of you, yes it is by me and was written to assist other group members to start adding c/c++ code to

[R] R packages

2007-01-30 Thread Shubha Vishwanath Karanth
Hi, Do any body know which packages of R I need to go for the below topics? 1. Monte Carlo Markov chain (MCMC) 2. Gibbs Sampling 3. Metropolis Hastings Thanks in advance... Shubha [[alternative HTML version deleted]] ___

Re: [R] rbind-ing list

2007-01-30 Thread jiho.han
thanks for all those who added great comments (and solutions) to my problem!! thanks- jh jiho.han wrote: > > hi, > > i have a list of data.frame that has same structure. i would like to know > a efficient way of rbind-ing it. > right now, i write: > > > n = length(temp) # 'temp' is a

Re: [R] R and S-Plus got the different results of principal component analysis from SAS, why?

2007-01-30 Thread Gavin Simpson
On Tue, 2007-01-30 at 22:29 +0800, zhijie zhang wrote: > Dear Rusers, > > I have met a difficult problem on explaining the differences of principal > component analysis(PCA) between R,S-PLUS and SAS/STATA/SPSS, which wasn't > met before. > > Althought they have got the same eigenvalues, their

Re: [R] jump in sequence

2007-01-30 Thread Robin Hankin
> f <- function(n){as.vector(sweep(matrix(4:6,nrow=3,ncol=n),2,seq (from=0,by=9,len=n),"+"))} > f(10) [1] 4 5 6 13 14 15 22 23 24 31 32 33 40 41 42 49 50 51 58 59 60 67 68 69 76 77 78 85 86 87 > HTH rksh On 30 Jan 2007, at 14:29, Adrian DUSA wrote: > Dear list, > > This should be a s

Re: [R] R and S-Plus got the different results of principal component analysis from SAS, why?

2007-01-30 Thread Peter Dalgaard
zhijie zhang wrote: > Dear Rusers, > > I have met a difficult problem on explaining the differences of principal > component analysis(PCA) between R,S-PLUS and SAS/STATA/SPSS, which wasn't > met before. > > Althought they have got the same eigenvalues, their coeffiecients were > different. > >

Re: [R] jump in sequence

2007-01-30 Thread Adrian Dusa
On Tuesday 30 January 2007 16:38, Peter Dalgaard wrote: > >[...snip...] > Is this it? > > > as.vector(outer(0:2,seq(4,22,9),"+")) > > [1] 4 5 6 13 14 15 22 23 24 Indeed it is :)) Thanks, Adrian -- Adrian Dusa Romanian Social Data Archive 1, Schitu Magureanu Bd 050025 Bucharest sector 5 Romani

Re: [R] jump in sequence

2007-01-30 Thread Martin Becker
Adrian DUSA wrote: > Dear list, > > This should be a simple one, I just cannot see it. > I need to generate a sequence of the form: > 4 5 6 13 14 15 22 23 24 > > That is: starting with 4, make a 3 numbers sequence, jump 6, then another 3 > and so on. > I can create a whole vector with: > myvec <-

Re: [R] sequencial frequency table

2007-01-30 Thread Marc Schwartz
On Tue, 2007-01-30 at 10:03 -0300, Mauricio Cardeal wrote: > Hi. > > I have the data frame xyz below and I´d like to perform a sequencial > frequency table using some unique function instead of making 3 different > one-by-one table (table x, table y and table z). But I´can´t figure out > the co

Re: [R] jump in sequence

2007-01-30 Thread Benilton Carvalho
is it sth like: as.integer(sapply(seq(4, 22, by=9), seq, length.out=3)) you're looking for? b On Jan 30, 2007, at 9:29 AM, Adrian DUSA wrote: > Dear list, > > This should be a simple one, I just cannot see it. > I need to generate a sequence of the form: > 4 5 6 13 14 15 22 23 24 > > That is

[R] R and S-Plus got the different results of principal component analysis from SAS, why?

2007-01-30 Thread zhijie zhang
Dear Rusers, I have met a difficult problem on explaining the differences of principal component analysis(PCA) between R,S-PLUS and SAS/STATA/SPSS, which wasn't met before. Althought they have got the same eigenvalues, their coeffiecients were different. First, I list my results from R,S-P

Re: [R] jump in sequence

2007-01-30 Thread Peter Dalgaard
Adrian DUSA wrote: > Dear list, > > This should be a simple one, I just cannot see it. > I need to generate a sequence of the form: > 4 5 6 13 14 15 22 23 24 > > That is: starting with 4, make a 3 numbers sequence, jump 6, then another 3 > and so on. > I can create a whole vector with: > myvec <-

[R] jump in sequence

2007-01-30 Thread Adrian DUSA
Dear list, This should be a simple one, I just cannot see it. I need to generate a sequence of the form: 4 5 6 13 14 15 22 23 24 That is: starting with 4, make a 3 numbers sequence, jump 6, then another 3 and so on. I can create a whole vector with: myvec <- rep(rep(c(F, T, F), rep(3, 3)), 3)

Re: [R] Adding Scale to image

2007-01-30 Thread Vladimir Eremeev
Dr. med. Peter Robinson wrote: > > I have used the image() function to show a heat plot of a matrix of data > whose intensity is color-coded. I have two questions that I have not > been able to solve by using the help system or google. > > 1) How can one add a scale/legend that shows what nu

[R] sequencial frequency table

2007-01-30 Thread Mauricio Cardeal
Hi. I have the data frame xyz below and I´d like to perform a sequencial frequency table using some unique function instead of making 3 different one-by-one table (table x, table y and table z). But I´can´t figure out the correct way. x <- c(2,3,2,4) y <- c(3,1,1,1) z <- c(4,2,1,4) xyz <- as.d

Re: [R] Permutation problem

2007-01-30 Thread Robin Hankin
Hi > library(gtools) > combinations(5,3) [,1] [,2] [,3] [1,]123 [2,]124 [3,]125 [4,]134 [5,]135 [6,]145 [7,]234 [8,]235 [9,]245 [10,]345 > On 30 Jan 2007, at 12:

[R] Adding Scale to image

2007-01-30 Thread Peter Robinson
Dear List, I have used the image() function to show a heat plot of a matrix of data whose intensity is color-coded. I have two questions that I have not been able to solve by using the help system or google. 1) How can one add a scale/legend that shows what numerical values a given color corr

Re: [R] Permutation problem

2007-01-30 Thread jim holtman
> help.search('combination') > ?combn > combn(1:5,3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]111111222 3 [2,]222334334 4 [3,]345455455 5 > On 1/30/07, michel

Re: [R] how to join two arrays using their column names intersection

2007-01-30 Thread jim holtman
> ar1 <- array(data=c(1:16),dim=c(4,4)) > ar2 <- array(data=c(1:16),dim=c(4,4)) > colnames(ar1)<-c("A","B","D","E") > colnames(ar2)<-c("C","A","E","B") > > ar1 A B D E [1,] 1 5 9 13 [2,] 2 6 10 14 [3,] 3 7 11 15 [4,] 4 8 12 16 > ar2 C A E B [1,] 1 5 9 13 [2,] 2 6 10 14 [3,] 3 7 11 1

[R] Permutation problem

2007-01-30 Thread michel lang
Dear R-Users, I need a matrix containing line by line all possible permutations with length 'i' of the integers 1:N, given the restriction that the integers in each row have to be in ascending order. For example: N = 5, length i = 3, should result in a matrix like this: 1 2 3 1 2 4 1 2 5 1

Re: [R] How to find series of small numbers in a big vector?

2007-01-30 Thread jim holtman
You can use 'rle' > search_range <- c (0.021, 0.029) # inclusive searching > search_length <- 5 # find ALL series of 5 members within search_range > my_data <- c(0.900, 0.900, 0.900, 0.900, 0.900, + 0.900, 0.900, 0.900, 0.900, 0.900, + 0.900, 0.028, 0.024, 0.027, 0.023, +

Re: [R] How to find series of small numbers in a big vector?

2007-01-30 Thread Michael Dewey
At 01:49 30/01/2007, Ed Holdgate wrote: >Hello: > >I have a vector with 120,000 reals >between 0.0 and 0. > >They are not sorted but the vector index is the >time-order of my measurements, and therefore >cannot be lost. > >How do I use R to find the starting and ending >index of ANY and AL

Re: [R] how to join two arrays using their column names intersection

2007-01-30 Thread Vladimir Eremeev
dfr1<-merge(ar1,ar2,all=TRUE) result<-as.matrix(dfr1[apply(dfr1,2,function(x)!any(is.na(x)))]) Federico Abascal wrote: > > Dear all, > > I have a problem that may be someone of you can help. I am a newbie and > do not find how to do it in manuals. > > I have two arrays, for example: > > ar1

[R] about sorting

2007-01-30 Thread Vladimir Eremeev
see ?order ar2[,order(colnames(ar2))] Federico Abascal wrote: > > I have another question: how can I sort the columns of an array > according to its column names (for ar2, change CAEB to ABCE)? > -- View this message in context: http://www.nabble.com/-R--how-to-join-two-arrays-using-their-c

Re: [R] how to join two arrays using their column names intersection

2007-01-30 Thread Federico Abascal
I have found something that partially works. Just to illustrate what am I looking for: for(a in colnames(ar1)) {if(a %in% colnames(ar2)) { cat(a, "\t", ar1[,a],"\t",ar2[,a],"\n")}} A1 2 3 4 5 6 7 8 B5 6 7 8 13 14 15 16 E13 14 15 16 9 10 11 12 I think I

Re: [R] How to find series of small numbers in a big vector?

2007-01-30 Thread Jonne Zutt
I suggest the following appraoch This gives TRUE for all data within the search_range A1 = my_data > search_range[1] & my_data < search_range[2] which() gives us the indices A2 = which(A1) and diff() the gaps between those intervals A3 = diff(A2) Hence, if A3 > search_le

Re: [R] How to find series of small numbers in a big vector?

2007-01-30 Thread Vladimir Eremeev
I would try using na.contiguos from package stats. R.utils has seqToIntervals.defaul, which "Gets all contigous intervals of a vector of indices". (I didn't use the latter, help.search("contiguous") gave me that name). -- View this message in context: http://www.nabble.com/-R--How-to-find-ser

[R] how to join two arrays using their column names intersection

2007-01-30 Thread Federico Abascal
Dear all, I have a problem that may be someone of you can help. I am a newbie and do not find how to do it in manuals. I have two arrays, for example: ar1 <- array(data=c(1:16),dim=c(4,4)) ar2 <- array(data=c(1:16),dim=c(4,4)) colnames(ar1)<-c("A","B","D","E") colnames(ar2)<-c("C","A","E","B")

Re: [R] Rbind for appending zoo objects

2007-01-30 Thread Achim Zeileis
On Tue, 30 Jan 2007, Shubha Vishwanath Karanth wrote: > 1.The above rbind function for the zoo objects doesn't take care > of the column names while merging. Example: Column 'a' of y1 is appended > with column 'b' of y2. Why is this so? We do not check the column names at all. This should pro

[R] How to find series of small numbers in a big vector?

2007-01-30 Thread Ed Holdgate
Hello: I have a vector with 120,000 reals between 0.0 and 0. They are not sorted but the vector index is the time-order of my measurements, and therefore cannot be lost. How do I use R to find the starting and ending index of ANY and ALL the "series" or "sequences" in that vector whe

Re: [R] rbind-ing list

2007-01-30 Thread Patrick Burns
The original poster is correct that the loop can be astoundingly inefficient. The issue is not so much overwriting a variable, but increasing its size as it is overwritten. In cases where 'do.call' won't do, then a good approach is to create the object with its final size and then subscript into

Re: [R] Rbind for appending zoo objects

2007-01-30 Thread Gabor Grothendieck
That is how rbind in the core of R works too and rbind.zoo works the same. Try: rbind(y1, y2[, colnames(y1)]) On 1/30/07, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi R, > > > > y1 <- zoo(matrix(1:10, ncol = 2), 1:5) > > colnames(y1)=c("a","b") > > y2 <- zoo(matrix(rnorm(10), ncol

Re: [R] countour and poygon shading

2007-01-30 Thread Jim Lemon
J.M. Breiwick wrote: > Hi, > > I have a contour plot and I want to shade a polygon (the area below a line) > but the polygon shading wipes out the contour lines. Does anybody know how > to shade the polygon and still see the contour lines? Thanks. > Hi Jeff, If you're talking about polygon.shad

Re: [R] Appending zoo objects

2007-01-30 Thread Gabor Grothendieck
You can use rbind.zoo if the times do not overlap. On 1/30/07, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Hi everybody, > > > > How do we append (note: it's not merging) two zoo objects with the same > column names? > > > > Thanks, > > Shubha > > >[[alternative HTML version del

[R] Rbind for appending zoo objects

2007-01-30 Thread Shubha Vishwanath Karanth
Hi R, y1 <- zoo(matrix(1:10, ncol = 2), 1:5) colnames(y1)=c("a","b") y2 <- zoo(matrix(rnorm(10), ncol = 2), 6:10) colnames(y2)=c("b","a") > y1 a b 1 1 6 2 2 7 3 3 8 4 4 9 5 5 10 > y2 b a 6 0.9070204 0.3527630 7 1.2405943 0.8275001 8 -0.169

[R] Using invisible function

2007-01-30 Thread talepanda
Dear R-er: I want to use invisible function in some packages. I know that triple colon operater is available. However, how can I use all invisible functions in some packages. One solution is , of course, to use ":::" in every use, but is there any workaround? It is similar to "using namespace"

Re: [R] Finding the Min.

2007-01-30 Thread Jarimatti Valkonen
stat stat wrote: > I want to see at which row minimum value of the second column occures. > > Therefore I made the following loop: [snip while-loop] > > Is there any more effective way to do that in terms of time consumption? I don't know about timing, but I understand that loops are

Re: [R] Finding the Min.

2007-01-30 Thread Pfaff, Bernhard Dr.
?which.min > >Dear all R users, > > Suppose I have a dataset like that, data = > > 1 1.957759e-09 >2 1.963619e-09 >3 1.962807e-09 >4 1.973951e-09 >5 1.983401e-09 >6 1.990894e-09 >7 2.000935e-09 >8

[R] R syntax highlighting for FAR manager's plugin Colorer

2007-01-30 Thread Vladimir Eremeev
Does anyone use FAR manager? If yes, does that one use the Colorer plugin with the FAR? And, if yes, does that one have a file for Colorer, describing R syntax? :) -- View this message in context: http://www.nabble.com/R-syntax-highlighting-for-FAR-manager%27s-plugin-Colorer-tf3141231.html#a8706

[R] Finding the Min.

2007-01-30 Thread stat stat
Dear all R users, Suppose I have a dataset like that, data = 1 1.957759e-09 2 1.963619e-09 3 1.962807e-09 4 1.973951e-09 5 1.983401e-09 6 1.990894e-09 7 2.000935e-09 8 1.998391e-09 9