[R] Comments disappearing from local functions (R 2.14.0)

2011-11-21 Thread p_connolly
I've installed R-2.14.0 from source on CentOS and on Kubuntu and in both cases, I see something I've never seen before. Comments in locally written functions disappear. I put comments there for a purpose and I'd like to keep them. I can still use older versions of R without that happening. Noth

[R] Survival curves for case control and control

2011-11-21 Thread kende jan
Hi, I want to perform Survival curves for case and control subjects in the propensity score-matched cohort  that accounted for the clustering of matched pairs. How I can do it with R. Thanks for your help, Jan [[alternative HTML version deleted]] __

Re: [R] Cox proportional hazards confidence intervals

2011-11-21 Thread peter dalgaard
On Nov 21, 2011, at 05:50 , David Winsemius wrote: > > On Nov 20, 2011, at 6:34 PM, Paul Johnston wrote: >> ... >> I had intended to report logrank P values with the hazard ratio and CI >> obtained from this function. In one case the P was 0.04 yet the CI >> crossed one, which confused me, and

Re: [R] Comments disappearing from local functions (R 2.14.0)

2011-11-21 Thread Rolf Turner
On 21/11/11 20:52, p_conno...@slingshot.co.nz wrote: I've installed R-2.14.0 from source on CentOS and on Kubuntu and in both cases, I see something I've never seen before. Comments in locally written functions disappear. I put comments there for a purpose and I'd like to keep them. I can stil

[R] legend with pch and colors possible?

2011-11-21 Thread Knut Krueger
Hi to all is it possible to build a legend with plot(NA, type = "l",col="blue",lwd=2,ylim=c(-0.05,10),xlim=c(0,13),xaxt = "n",xlab="",ylab="") # Grafikmodus mit erster Linie starten Lcolors=c("blue","orchid","green") lsymbols= c(16,17,15) Ltext= c("text1","tex2","text3") legend("topleft",cex=

Re: [R] legend with pch and colors possible?

2011-11-21 Thread Jim Lemon
On 11/21/2011 07:55 PM, Knut Krueger wrote: Hi to all is it possible to build a legend with plot(NA, type = "l",col="blue",lwd=2,ylim=c(-0.05,10),xlim=c(0,13),xaxt = "n",xlab="",ylab="") # Grafikmodus mit erster Linie starten Lcolors=c("blue","orchid","green") lsymbols= c(16,17,15) Ltext= c("te

[R] [R-pkgs] Package HiveR 0.1-4 Released

2011-11-21 Thread Bryan Hanson
I am pleased to announce the first release of HiveR, a package to draw 2D and 3D Hive Plots. It's currently on CRAN and on it's way to a mirror near you. Hive plots are a unique method of displaying networks of many types in which node properties are mapped to axes using meaningful properties rat

[R] invalid command name "tk::MenuDup"

2011-11-21 Thread habasque
Hi to all, I'm developping an user interface in TCL/TK but in some computers this error occurs : invalid command name "tk::MenuDup" when the user runs : tm <- tktoplevel(height=500,width=800) topMenu <- tkmenu(tm) tkconfigure(tm,menu=topMenu) i don't understand why this code works on my compute

[R] Change names on dataset

2011-11-21 Thread Joel
Hi fellow R users. I have a problem when i try to change the Names of the columns on a dataset: The names of the names dataset looks like this: toPlot > names(toPlot) [1] "REPORT_20" "REPORT_21" "REPORT_22" "REPORT_23" [5] "REPORT_24" "REPORT_25" "REPORT_QREP001" "

[R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Giovanni Azua
Hello, I know there is plenty of people in this group who can give me a good answer :) I have a 2^k model where k=4 like this: Model 1) R~A*B*C*D If I use the "*" in R among all elements it means to me to explore all interactions and include them in the model i.e. I think this would be the so

Re: [R] Import Access MDB on line

2011-11-21 Thread Raphael Saldanha
On Fri, Nov 18, 2011 at 12:16 PM, Barry Rowlingson wrote: > > On Fri, Nov 18, 2011 at 1:53 PM, Raphael Saldanha > wrote: > > >  I would like > > to import this dataset direct into R, without saving the file on disk > > (for using the most updated file), > >  You don't really have much choice - I'

[R] lm and loop over variables

2011-11-21 Thread Johannes Radinger
Hello, I think I am not to far from a solution. I want to do lm regressions with several variables which I define before in a list. What I've done so far is like: y <- c(1,5,6,2,5,10) # response x1 <- c(2,12,8,1,16,17) # predictor x2 <- c(2,14,5,1,17,17) df <- data.frame(y,x1,x2) predictorlist

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Giovanni Azua
Hello, Couple of clarifications: - A,B,C,D are factors and I am also interested in possible interactions but the model that comes out from aov R~A*B*C*D violates the model assumptions - My 2^k is unbalanced i.e. missing data and an additional level I also include in one of the factors i.e. C -

Re: [R] invalid command name "tk::MenuDup"

2011-11-21 Thread Uwe Ligges
On 21.11.2011 11:00, habasque wrote: Hi to all, I'm developping an user interface in TCL/TK but in some computers this error occurs : invalid command name "tk::MenuDup" when the user runs : tm<- tktoplevel(height=500,width=800) topMenu<- tkmenu(tm) tkconfigure(tm,menu=topMenu) i don't unde

Re: [R] S4 : defining [<- using inheritance from 2 classes

2011-11-21 Thread cgenolin
My working example is in the package kml3d. The class 'clusterLongData' is define by inehirance from class 'listClustering' and 'longitudinalData'. But as you say, it is unusual, I will try an other way. Thank you for your help. Christophe -- View this message in context: http://r.789695.n4.nab

Re: [R] coverage plot

2011-11-21 Thread Martin Morgan
On 11/20/2011 07:45 PM, sutada Mungpakdee wrote: Hi, I'm very beginner for R but I think it is a time to start as it is very useful. I have a coverage read file (illusmp454merCbed) for whole genome ~ 450 Mbp. This is head of this file. Scaffoldsca_positioncoverage Scaffold1 1

Re: [R] lm and loop over variables

2011-11-21 Thread Uwe Ligges
On 21.11.2011 13:34, Johannes Radinger wrote: Hello, I think I am not to far from a solution. I want to do lm regressions with several variables which I define before in a list. What I've done so far is like: y<- c(1,5,6,2,5,10) # response x1<- c(2,12,8,1,16,17) # predictor x2<- c(2,14,5,1,

Re: [R] Change names on dataset

2011-11-21 Thread Uwe Ligges
On 21.11.2011 11:40, Joel wrote: Hi fellow R users. I have a problem when i try to change the Names of the columns on a dataset: The names of the names dataset looks like this: toPlot names(toPlot) [1] "REPORT_20" "REPORT_21" "REPORT_22" "REPORT_23" [5] "REPORT_24" "

Re: [R] Need help

2011-11-21 Thread Uwe Ligges
On 21.11.2011 07:17, dilshan benaragama wrote: Hi, R development team, I am trying to use PCA in labdsv package.I need to build the ordination plot from scratch. I used the following code (which is used in RDA) and I cannot get the species (variable centroids) to the ordination plot, only

[R] stepAIC

2011-11-21 Thread David martin
Hi, I'm trying to select the best model for a particular problem. So far i have managed to identify a set of variables that woudl explain my model lm1 <- lm(Group ~ . , data=dataf)) > summary(lm1) Df Sum Sq Mean Sq F valuePr(>F) `A` 1 2.3963 2.3963 24.0390 7.328e-06

Re: [R] Setting hostname in the .Renvironment

2011-11-21 Thread Uwe Ligges
On 21.11.2011 01:32, Jonathan Greenberg wrote: This is a follow-up to a question I asked a few years back. We have a pair of computers that share a common home directory (and therefor a common .Renviron) with identical hardware, but very different sets of libraries such that using a "shared" R

Re: [R] lm and loop over variables

2011-11-21 Thread Johannes Radinger
Hi, Original-Nachricht > Datum: Mon, 21 Nov 2011 14:46:17 +0100 > Von: Uwe Ligges > An: Johannes Radinger > CC: r-help@r-project.org > Betreff: Re: [R] lm and loop over variables > > > On 21.11.2011 13:34, Johannes Radinger wrote: > > Hello, > > > > I think I am not to far

Re: [R] Adding two or more columns of a data frame for each row when NAs are present.

2011-11-21 Thread Ian Strang
Hi, Thanks, your method does indeed work. Thank you. Last night, I worked out something similar and found out about rowMeans as well. Kind wishes, Ian yy <- read.table( header = T, sep=",", text = "Q20, Q21, Q22, Q23, Q24 0,1, 2,3,4 1,NA,2,3,4 2,1, 2,3,4 5,NA,3,NA,NA") yy Q20 Q21 Q22 Q23

Re: [R] Deleting multiple rows from a data matrix based on exp value

2011-11-21 Thread Peter Davidsen
Hi, Thanks for the quick reply. However, your suggestion doesn't solve the problem I'm afraid (i.e dim(Matrix) still the same). What I want is to reduce the number of rows (probesets) markedly based on their normalized intensity - thus I've chosen a cut-off of 1.11 When I run your code (as well a

Re: [R] install.package tseries

2011-11-21 Thread jandrade
I could not install the tseries package. Problem solved. I had an older version of R and it did not work well with Mac OSX I installed the 2.14 version and it works fine. -- View this message in context: http://r.789695.n4.nabble.com/install-package-tseries-tp4090411p4091251.html Sent from the

[R] In-place modification of a matrix

2011-11-21 Thread simon . conroy
Hello, Using the technique suggested here ( https://stat.ethz.ch/pipermail/r-devel/2007-September/047028.html), we can update a matrix in place (see example 1 below), with huge time and memory savings. Is it possible to tweak example 2 to update in place also? The only difference is that the

[R] Problems using log() in a plm() regression.

2011-11-21 Thread ManuelS
hey guys I have a panel data set that i want to perform some regressions on. I am using the /plm/ package. I defined a model in the following way: PWBw.pool <- plm(*PWB* ~ log(*I_EQON*) + log(*RD*) + ... + *PAGRI*, data = pfem, na.action=na.exclude, model="pooling") When i run this it gives the

Re: [R] Deleting multiple rows from a data matrix based on exp value

2011-11-21 Thread R. Michael Weylandt
Inline. On Mon, Nov 21, 2011 at 5:41 AM, Peter Davidsen wrote: > Hi, > > Thanks for the quick reply. > However, your suggestion doesn't solve the problem I'm afraid (i.e > dim(Matrix) still the same). What I want is to reduce the number of > rows (probesets) markedly based on their normalized int

Re: [R] legend with pch and colors possible?

2011-11-21 Thread Knut Krueger
Am 21.11.2011 10:06, schrieb Jim Lemon: > > Hi Knut, > Have a look at the legendg function (plotrix). > Hi Jim Thanks for the package it is very useful .. but I did not solve my problem. As I have not much time I tried some basic configuration but the characters are einther above the colored sqar

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Bert Gunter
Giovanni: 1. Please read ?formula and/or An Introduction to R for how to specify linear models in R. 2. Correct specification of what you want (if I understand correctly) is log(R) ~ A*B + C + D 3. ... which presumably will also fail because some of your factors have only one level, which means

Re: [R] Change names on dataset

2011-11-21 Thread Jeff Newmiller
I would guess you have factors instead of strings. Use as.character() or the appropriate parameter to prevent generation of factors when you import the names into R. --- Jeff NewmillerThe .

Re: [R] Replacing values in matrix/dataframe according to changing criteria

2011-11-21 Thread Frederik Lyngsaa Lang
Dear Michael, First, thanks a lot for your suggestion. It seems to work very well. However, trying to implement it into my code I realize the rest of my code is simply running too slowly due to a lot of loops. The problem lies in the step where I read in a text file showing the different communit

Re: [R] Searching for the first two characters of a string

2011-11-21 Thread aclinard
Remko, Thank you for your reply. When I try your code, I'm getting the following error: acts10 <-read.table('RailAccident10.txt',sep=',',header=T) > acts11 <- acts10[acts10$ACCDMG > 10^5,] > h.test <- substr(acts11$CAUSE,1,1) > h.data <- acts11[h.test == 'H'] Error in `[.data.frame`(acts11, h.tes

Re: [R] Data analysis: normal approximation for binomial

2011-11-21 Thread John Kane
You need a statistician or at least someone who's take a stats course in the last 10 years but it may be what the author was trying to get at.  At least the binomial is descrete as is the z so it may be that the z was used as easier to calculate than a binomial?  How old is the paper. Before,

Re: [R] Searching for the first two characters of a string

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 10:00 AM, aclinard wrote: Remko, Thank you for your reply. When I try your code, I'm getting the following error: acts10 <-read.table('RailAccident10.txt',sep=',',header=T) acts11 <- acts10[acts10$ACCDMG > 10^5,] h.test <- substr(acts11$CAUSE,1,1) h.data <- acts11[h.te

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Giovanni Azua
Hello Bert, Thank you for taking the time to try to answer. 1) I know this, however if one is interested in only interaction between two specific factors then in R one uses I(A*B*C) meaning 3-way anova for that and not the implicit 2-ways that would otherwise be computed. 2) True, but it fails

Re: [R] Difference between two time series

2011-11-21 Thread R. Michael Weylandt
As I said before: please dput() some working data and I'll try to work something up. Without it, the only thing I can reasonably suggest is that perhaps you are looking for the window() function to be applied before min/max. Something like: X <- ts(1:48, start = 1, frequency = 4) Y <- ts(1:12, st

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread ONKELINX, Thierry
Giovanni, Have you tried Bert suggestion 2)? Because his log(R) ~ A*B + C + D is NOT the same as your log(R)~A+B+I(A*B)+C+D Note that I(A * B) means: create a new variable that is the product of A and B. Which is not meaningfull if A and B are factors (hence the warning you got). So I(A * B) is

[R] Weird R's behaviour with a quoted name

2011-11-21 Thread Kamil Bartoń
Can someone explain why the following happens? --- :> quote(some.name) some.name :> bar <- structure(quote(some.name), class = "foo") :> quote(some.name) Error in print(some.name) : object 'some.name' not found :> bar <- quote(some.name) :> quote(some.name) Error in print(some.name) : object 'some

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Rob Griffin
the way I interpret the problem (and I may be wrong here, I don't think you have been particularly clear with your question) is that you are trying to make a factorial anova where you are trying to explain "R" as a result of A,B,C and D, and their interaction terms. so using A*B*C*D. what you sh

Re: [R] Sub sets

2011-11-21 Thread R. Michael Weylandt
I'd appreciate it if you'd keep on list for the archives. That said, I think this function does what you were hoping for. Michael powerset <- function(n, items = NULL){ if(!is.null(items)) { if(n != length(items)) warning("Resetting n in preference to length(items)") n = lengt

Re: [R] Weird R's behaviour with a quoted name

2011-11-21 Thread William Dunlap
This is a bug in R: it either should prohibit the attaching of attributes to things of class "name" or should make it so that attachment of an attribute doesn't have such a global effect. A more direct example of the problem is: > attributes(quote(some.name)) NULL > bar <- structure(quote(so

Re: [R] Continuasly Compunded Returns with quantmod-data

2011-11-21 Thread barb
Many Thanks - Also for the link! It works nice! If i have further question, can i post them here or should i open a new thread? 1) If i want the following to make a function: I do have to convert it, but i can´t get rid of these " " (brackets). func<-function(y) { library(quantmod) getSymbols

[R] R ignores number only with a nine under 10000

2011-11-21 Thread set
Hello R users, I'm trying to replace numerical values in a datamatrix with strings. R does this except for numbers under 1 starting with a 9 (eg 98, 970, 9504 etc). This is really weird and I wondered whether someone had encountered such a problem or knows the solution. I'm using the next scri

[R] Sensitivity and Specificity Forest Plots

2011-11-21 Thread Jonathan Minton
Dear R Users, Do you know of an existing function that allows the production of sensitivity and specificity forest plots? See the following for an example: http://www.google.co.uk/imgres?q=forest+plots+of+sensitivity+and+specificity&um=1&hl=en&authuser=0&biw=1920&bih=989&tbm=isch&tbnid=JLxXNU7iQ2N

[R] Discarding a matrix based on the rowSums value

2011-11-21 Thread Juan Antonio Balbuena
Hello I would appreciate your help on the followig. I want to generate random binary matrices but I need to discard those with all-1 rows. That is, for a 10x10 matrix with five 1's [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]000000000 1 [2

Re: [R] Continuasly Compunded Returns with quantmod-data

2011-11-21 Thread R. Michael Weylandt
1) It's sort of a cheap trick, but this works flexibly (i.e., you can put in func(SPY) or func("SPY") and get the same output): func <- function(y){ if(!require(quantmod)) stop("You need the quantmod package.") chartSeries(get(getSymbols(as.character(substitute(y)), from = "2011-11-01")))

Re: [R] R ignores number only with a nine under 10000

2011-11-21 Thread R. Michael Weylandt
This can't be reproduced without data -- kindly supply the result of test_1 right after the first line using dput() if you would. Michael On Mon, Nov 21, 2011 at 10:42 AM, set wrote: > Hello R users, > > I'm trying to replace numerical values in a datamatrix with strings. R does > this except fo

Re: [R] Sub sets

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 11:42 AM, R. Michael Weylandt wrote: I'd appreciate it if you'd keep on list for the archives. That said, I think this function does what you were hoping for. Michael powerset <- function(n, items = NULL){ if(!is.null(items)) { if(n != length(items)) warning("Res

Re: [R] Discarding a matrix based on the rowSums value

2011-11-21 Thread R. Michael Weylandt
any() Michael On Mon, Nov 21, 2011 at 10:58 AM, Juan Antonio Balbuena wrote: > Hello > I would appreciate your help on the followig. I want to generate random > binary matrices but I need to discard those with all-1 rows. That is, for a > 10x10 matrix with five 1's > >      [,1] [,2] [,3] [,4] [

Re: [R] Discarding a matrix based on the rowSums value

2011-11-21 Thread Sarah Goslee
Hi, You write below: > What I specifically need is a way to write "If any of the elements of the > SUMROW vector == N.1s then flag <-true else flag<-false". And in fact, ?any is just what you need, as you said. any(SUMROW == N.1s) should do the trick. Sarah On Mon, Nov 21, 2011 at 10:58 AM, J

Re: [R] R ignores number only with a nine under 10000

2011-11-21 Thread Jeff Newmiller
1) "datamatrix" is not a defined term. I think you mean "data.frame". 2) you have not supplied any sample data, so your example is not reproducible. 3) All of the values in a vector (i.e. a column of a data.table must be of the same type, be that character or numeric (or anything else, such as f

Re: [R] Discarding a matrix based on the rowSums value

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 10:58 AM, Juan Antonio Balbuena wrote: Hello I would appreciate your help on the followig. I want to generate random binary matrices but I need to discard those with all-1 rows. That is, for a 10x10 matrix with five 1's [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]

Re: [R] Continuasly Compunded Returns with quantmod-data

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 11:58 AM, R. Michael Weylandt wrote: 1) It's sort of a cheap trick, but this works flexibly (i.e., you can put in func(SPY) or func("SPY") and get the same output): func <- function(y){ if(!require(quantmod)) stop("You need the quantmod package.") chartSeries(get(getS

[R] aq.plot outcome

2011-11-21 Thread agent dunham
Dear Community, I would like to know if the outliers from the outcome of aq.plot are the ones with probability associated with D2 is < .001. Thanks in advance, u...@host.com -- View this message in context: http://r.789695.n4.nabble.com/aq-plot-outcome-tp4092210p4092210.html Sent from the R

[R] ANOSIM boxplot problem

2011-11-21 Thread arivald
Hello! I have a binary data from DGGE gel with 20 samples. These samples are divided into 4 groups, so there are 4(groups) x 5(replicas) = 20. I used ANOSIM method, and everything is ok but ... I have a problem with boxplot... like this: distance <- vegdist(dgge2, method="jaccar

[R] errors with lme4

2011-11-21 Thread Alessio Unisi
Dear list, i'm a new R user, so I apologize if the topic is already being addressed by some other user. I'm trying to determine if the reproductive success of a species of bird is related to a list of covariates. These are the covariates: §elev: elevation of nest (meters) §seadist: d

Re: [R] Interpolating hourly basis

2011-11-21 Thread R. Michael Weylandt
You didn't dput() your data as I asked so I can't work with it, but, to get you started, here's an example of how you could do interpolation of the sort you seem interested in using xts objects. (It also seems like you need to decide what to make of the repeated measurements before trying to extrap

[R] Creating a list from all combinations of two lists

2011-11-21 Thread Jonathan Greenberg
R-helpers: Say I have two lists of arbitrary elements, e.g.: list1=list(c(1:3),"R is fun!",c(3:6)) list2=list(c(10:5),c(5:3),c(13,5),"I am so confused") I would like to produce a single new list that is composed of all combinations of the "top level" of list1 and list2, e.g.: listcombo=list(

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Bert Gunter
Thanks Thierry: I had missed that the OP's failure to read the formula docs and use of I(A*B) was what caused the error. Mea Culpa. However, I actually agree with Giovanni's remarks about the difference between what is typically taught and what one faces in practice. Where we disagree is that I t

[R] Scatter plot - using colour to group points?

2011-11-21 Thread SarahH
Dear All, I am very new to R - trying to teach myself it for some MSc coursework. I am plotting temperature data for two different sites over the same time period which I have downloaded from a university weather station data archive. I am using the following code to create the plot plot ( x

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Giovanni Azua
Hello Rob, Thank you for your suggestions. I tried glm too without success. Anyhow I include all the information just in case someone with good knowledge can give me a hand with this. I take log of the response variable because: - its values span across multiple orders of magnitudes - the diag

[R] count ties after rank?

2011-11-21 Thread Hao, Zhaozhe
Hello! I need to use Kruskal-Wallis test and post-hoc test (Dunn's test) for my data. But when I searched around, I only found this function: kruskal.test. But nothing for Dunn's test. So I started to write one myself. But I do not know how to count ties in the data frame. I can use

Re: [R] Weird R's behaviour with a quoted name

2011-11-21 Thread luke-tierney
On Mon, 21 Nov 2011, William Dunlap wrote: This is a bug in R: it either should prohibit the attaching of attributes to things of class "name" or should make it so that attachment of an attribute doesn't have such a global effect. A more direct example of the problem is: > attributes(quote(som

Re: [R] count ties after rank?

2011-11-21 Thread Peter Langfelder
On Mon, Nov 21, 2011 at 11:36 AM, Hao, Zhaozhe wrote: > Hello! > >    I need to use Kruskal-Wallis test and post-hoc test (Dunn's test) for my > data. But when I searched around, I only found this function: kruskal.test. > But nothing for Dunn's test. > >    So I started to write one myself.  Bu

Re: [R] count ties after rank?

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 2:50 PM, Peter Langfelder wrote: On Mon, Nov 21, 2011 at 11:36 AM, Hao, Zhaozhe wrote: Hello! I need to use Kruskal-Wallis test and post-hoc test (Dunn's test) for my data. But when I searched around, I only found this function: kruskal.test. But nothing for Dunn'

Re: [R] count ties after rank?

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 2:36 PM, Hao, Zhaozhe wrote: Hello! I need to use Kruskal-Wallis test and post-hoc test (Dunn's test) for my data. But when I searched around, "Searching around" is a bit vague as a search strategy: Try :kruskal dunn" at the location that RSiteSearch gets you to: h

Re: [R] Scatter plot - using colour to group points?

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 2:17 PM, SarahH wrote: Dear All, I am very new to R - trying to teach myself it for some MSc coursework. I am plotting temperature data for two different sites over the same time period which I have downloaded from a university weather station data archive. I am usi

Re: [R] count ties after rank?

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 3:20 PM, Hao, Zhaozhe wrote: Hi, Thank you all for the the quick response. But there still some questions. 1) nTies = length(x) - length(unique(x)) cannot distinguish vector (1,2,2,2,3), and (1,2,2,3,3) 2) table(x)[table(x) >1] tells me the right number

Re: [R] Scatter plot - using colour to group points?

2011-11-21 Thread R. Michael Weylandt
I think the easiest way to do this is to set up a color vector with ifelse and hand that off to the plot command: something like col = ifelse(TEMP3[,"SITE"] == "BG1", "blue", "green") # Syntax is ifelse(TEST, OUT_IF_TRUE, OUT_IF_FALSE) For more complicated schemes, a set of nested ifelse()'s can

[R] forest plots from rmeta package

2011-11-21 Thread array chip
Hi, I am trying forestplot() and metaplot() from rmeta package to plot some hazard ratios. Now foreatplot() can draw clipping with "<" or ">" at the ends of the confidence line using "clip" argument, but can't use multiple colors for different lines. On the other hand, metaplot() can use differe

Re: [R] count ties after rank?

2011-11-21 Thread Hao, Zhaozhe
Hi, Thank you all for the the quick response. But there still some questions. 1) nTies = length(x) - length(unique(x)) cannot distinguish vector (1,2,2,2,3), and (1,2,2,3,3) 2) table(x)[table(x) >1] tells me the right number, but how can I call the numbers from the result o

[R] Lattice graph help

2011-11-21 Thread Andrew McFadden
Hi all I hope you might help me with some aspects of producing a graph in lattice. There are three things I have struggling with and that is: 1. to separate the horizontal box rows from each other; 2. to change the colour of the horizontal and vertical strips to white; and 3. to place the axes l

[R] Error building R 2.14.0 from sources on Win7 x64

2011-11-21 Thread Frédéric Fournier
Hello everyone, I'm trying to build R 2.14.0 from source on Win7 x64 using the instructions from "R Installation and Administration" (version 2.13.2), but when I try to make the core files (as of step 3.1.3 of the instructions), it fails with the following error: ... x86_64-w64-mingw32-gcc -std=gn

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Giovanni Azua
On Nov 21, 2011, at 8:31 PM, Bert Gunter wrote: > we disagree is that I think data analysts with limited statistical > backgrounds should consult with local statisticians instead of trying > to muddle through on their own thru lists like this. This is not meant I think that people lacking reading

Re: [R] Lattice graph help

2011-11-21 Thread Rainer Hurling
I just tried a litte bit with your dataset and hope to get a solution as wanted ;-) On 21.11.2011 21:55 (UTC+1), Andrew McFadden wrote: Hi all I hope you might help me with some aspects of producing a graph in lattice. There are three things I have struggling with and that is: 1. to separate t

Re: [R] R ignores number only with a nine under 10000

2011-11-21 Thread Dennis Murphy
Hi: Strictly a guess, but the following might be helpful. The call below assumes that the referent data frame is test1, which consists of a single column named x. Modify as appropriate. test_lab <- with(test1, cut(x, c(0, 18954, 37791, 56951, 75944, 84885, 113835), labels = c('I8

Re: [R] R ignores number only with a nine under 10000

2011-11-21 Thread Peter Langfelder
On Mon, Nov 21, 2011 at 7:42 AM, set wrote: > Hello R users, > > I'm trying to replace numerical values in a datamatrix with strings. R does > this except for numbers under 1 starting with a 9 (eg 98, 970, 9504 > etc). This is really weird and I wondered whether someone had encountered > such

Re: [R] [OT] 1 vs 2-way anova technical question

2011-11-21 Thread Rolf Turner
This sort of post seems to me to be completely unacceptable. Is there a mechanism by which the list manager can unsubscribe Mr. Azua and keep him unsubscribed until he learns some manners? cheers, Rolf Turner On 22/11/11 10:28, Giovanni Azua wrote: On Nov 21, 2011, at 8:31 PM, Ber

[R] How do I query "..." in a function call?

2011-11-21 Thread Jonathan Greenberg
This is probably a very noobish question, but if I want to create a function that allows an undetermined number of, say, numeric vectors to be fed to it, I would use: myfunction = function(...) { # Do something } Right? If so, how do I a) count the number of vectors "fed" to the function, and b

Re: [R] How do I query "..." in a function call?

2011-11-21 Thread Søren Højsgaard
You can do something like this: test <- function(x,...){ print(x) args = list(...) if('y' %in% names(args))print(args$y) if('z' %in% names(args))print(args$z) } Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project

Re: [R] How do I query "..." in a function call?

2011-11-21 Thread Steve Lianoglou
Hi Jonathan, On Mon, Nov 21, 2011 at 5:18 PM, Jonathan Greenberg wrote: > This is probably a very noobish question, but if I want to create a > function that allows an undetermined number of, say, numeric vectors to be > fed to it, I would use: > > myfunction = function(...) > { > # Do something

[R] arima.sim: innov querry

2011-11-21 Thread Andy Bunn
Apologies for thickness - I'm sure that this operates as documented and with good reason. However... My understanding of arima.sim() is obviously imperfect. In the example below I assume that x1 and x2 are similar white noise processes with a mean of 5 and a standard deviation of 1. I thought x

Re: [R] arima.sim: innov querry

2011-11-21 Thread Rolf Turner
On 22/11/11 13:04, Andy Bunn wrote: Apologies for thickness - I'm sure that this operates as documented and with good reason. However... My understanding of arima.sim() is obviously imperfect. In the example below I assume that x1 and x2 are similar white noise processes with a mean of 5 and a

Re: [R] R ignores number only with a nine under 10000

2011-11-21 Thread set
Thank you everybody! Eventually the Peter's trick did it! Thanks! -- View this message in context: http://r.789695.n4.nabble.com/R-ignores-number-only-with-a-nine-under-1-tp4091936p4093692.html Sent from the R help mailing list archive at Nabble.com. _

[R] Compare two time series, at each time step

2011-11-21 Thread lglew
Hi, I have two time series of NDVI data, one inside a protected area, and one outside. I have decomposed the time series, to remove the seasonal component and residual variation. I want to compare the long-term trends inside and outside of the protected area over time. So, at each time step (1 y

[R] readDGE: Error in colnames/length of dimnames not equal to array extent

2011-11-21 Thread jazevedo
Hello, all, I'm a new R user (new to any programming language in general, really), so I apologize if this is easy/has already been answered (I've attempted searching online but did not understand the pages I found). My data is stored in text files with the headers LANE, RNA_NAME, SEQ, and SEQCNT.

[R] Read from HTML file, print if see a specific string

2011-11-21 Thread yesitsjess
So basically I have made a HTML file with a table in it. Column 3 contains a GenBank number and is always proceeded by "=GenBank">". I want to read the file and return the number which comes directly after this (the contents of column 3). Ideally I would like to save this number as a string fo

Re: [R] Scatter plot - using colour to group points?

2011-11-21 Thread SarahH
I got the colour vector with ifelse to work, great! Thank you. Is it possible to use the ifelse colour vector with other plot types? For example with type=l ? I tried but the graphic came back with blue lines for both sites and also a straight line connecting the start and end point of the data?

Re: [R] Scatter plot - using colour to group points?

2011-11-21 Thread John Kane
Another approach would be to use ggplot2.  Code can look a bit daunting to begin with but ggplot2 is a very versitile graphing package and well worth learning. Simple example = library(ggplot2) mydata <- data.frame(site=c("A","A","A", "

[R] Session management in Rserv's java API

2011-11-21 Thread bati
Hi I am a newbie to R and I would like to ask a few questions about RServ Java API... My problem is, there will be many callers use my client web service (it uses the rosuda Rengine API) to connect to RServ (running on linux), instead of each caller establish a new connection, I would want to le

Re: [R] Scatter plot - using colour to group points?

2011-11-21 Thread R. Michael Weylandt
I don't think you can do different colors for a single line (not an ifelse thing, just a what would that mean sort of thing), but a plot type like "b" "o" or "h" will work the same way. Michael On Mon, Nov 21, 2011 at 4:23 PM, SarahH wrote: > I got the colour vector with ifelse to work, great! T

Re: [R] How do I query "..." in a function call?

2011-11-21 Thread Mark Leeds
Hi: You can make a list out of the ... by doing below. myfunction = function(...) { params <- list(...) print(params) print(str(params)) } On Mon, Nov 21, 2011 at 5:18 PM, Jonathan Greenberg wrote: > This is probably a very noobish question, but if I want to create a > function that allows an un

[R] Binned line plot

2011-11-21 Thread Jeffrey Joh
I have a scatter plot with 1 points.  I would like to add a line that bins every 50 points and connects the average of each bin.  I'm looking for something similar to line type "m" in Stata. With this dataset of 1 points, I would also like to bin the data and make boxplots at certain i

Re: [R] Scatter plot - using colour to group points?

2011-11-21 Thread David Winsemius
On Nov 21, 2011, at 10:18 PM, R. Michael Weylandt wrote: I don't think you can do different colors for a single line (not an ifelse thing, just a what would that mean sort of thing), but a plot type like "b" "o" or "h" will work the same way. I think Jim Lemon has a multicolored line function

Re: [R] Binned line plot

2011-11-21 Thread David Winsemius
On Nov 22, 2011, at 12:29 AM, Jeffrey Joh wrote: I have a scatter plot with 1 points. So you have numeric x and y values. I would like to add a line that bins every 50 points and connects the average of each bin. What is the rule to be applied to form these bins? You may want to l

Re: [R] Binned line plot

2011-11-21 Thread Joshua Wiley
Hi Jeffrey, See ?factor ?rep and ?cut basically you just need to create another variable that indicates what bin a point belongs to, and then you just do regular plots. If you want to mix the scatterplot and the binned points, you'll need to make sure the bins fall somehwere in the same space.

Re: [R] Binned line plot

2011-11-21 Thread Bert Gunter
A fast way to get **only** means of successive bins of width k of a vector z of length nk is: m <- colMeans(matrix(z,nrow = k)) (you wanted k =50) This was instantaneous for a length 1e6 numeric vector on my laptop. However, for anything else, you have to use something like cut() as others have

Re: [R] Creating a list from all combinations of two lists

2011-11-21 Thread Jim Lemon
On 11/22/2011 06:31 AM, Jonathan Greenberg wrote: R-helpers: Say I have two lists of arbitrary elements, e.g.: list1=list(c(1:3),"R is fun!",c(3:6)) list2=list(c(10:5),c(5:3),c(13,5),"I am so confused") I would like to produce a single new list that is composed of all combinations of the "

Re: [R] Error building R 2.14.0 from sources on Win7 x64

2011-11-21 Thread Prof Brian Ripley
On Mon, 21 Nov 2011, Frédéric Fournier wrote: Hello everyone, I'm trying to build R 2.14.0 from source on Win7 x64 using the instructions from "R Installation and Administration" (version 2.13.2), but when I try to make the core files (as of step 3.1.3 of the instructions), it fails with the fol

  1   2   >