[R] apply function

2008-05-14 Thread Shubha Vishwanath Karanth
Hi R, Getting a strange result using ?apply. Please look into the below codes: > d=data.frame(a=c(1,2,3),b=c("A","B","C"),c=c(TRUE,FALSE,FALSE),d=c(T,F,F )) > class(d[,1]) [1] "numeric" > class(d[,2]) [1] "factor" > class(d[,3]) [1] "logical" > class(d[,4]) [1] "logical" > ap

Re: [R] Attributes or list programming "efficiency"

2008-05-14 Thread Prof Brian Ripley
On Wed, 14 May 2008, Bert Gunter wrote: R-Fellow Travellers: Asked from the perspective of a software development amateur ... Suppose one wishes to create data structures that have both data and metadata -- e.g. a data.frame and details about where, when, and by whom the data were gathered (sp

Re: [R] console from tcltk

2008-05-14 Thread Prof Brian Ripley
On Wed, 14 May 2008, Gabor Grothendieck wrote: Thanks. I've updated to the latest R on the mirror I used and puts stdout 12 from tcl does indeed produce output from Rterm on Windows but gives an error message from Rgui on Windows (both on Windows Vista SP1). Not if you launch Rgui from a term

Re: [R] Help to Draw Plot

2008-05-14 Thread Don MacQueen
At 1:24 PM -0700 5/14/08, ermimi wrote: Patrick and Blay Thank you very much for help me, I have drawn in blue the axis Blay the solution that you give me for start in (-10,-10) and finish in (10,10) isn´t very well because I want that if my range is (-10,10) the axis is in -10,10. I need th

Re: [R] Attributes or list programming "efficiency"

2008-05-14 Thread Don MacQueen
At 2:26 PM -0400 5/14/08, Gabor Grothendieck wrote: The key difference is inheritance. Objects consisting of data frames with attributes, including a class attribute such as c("myclass", "data.frame), can inherit data frame methods but a list with a data frame component will require entirely new

Re: [R] howto get significant digits for round()

2008-05-14 Thread Don MacQueen
I must say, I can't deduce, from what you have said, what the desired rounding rule is. The following function does not do what you want, but maybe it's a little bit related... rounds function (x, val = 1) val * round(x/val) If length = 12.2232 and delta-length = 0.4 (delt

Re: [R] fancy text in pairs()

2008-05-14 Thread Charilaos Skiadas
On May 14, 2008, at 9:28 PM, [EMAIL PROTECTED] wrote: Dear List, I'm currently trying to produce a number of pairs() plots with special text labels in the diagonal panels giving the units for the various quantities. These labels stretch across multiple lines, with the names of the quantities a

[R] fancy text in pairs()

2008-05-14 Thread Michael . Scroggie
Dear List, I'm currently trying to produce a number of pairs() plots with special text labels in the diagonal panels giving the units for the various quantities. These labels stretch across multiple lines, with the names of the quantities and the symbols for the units on separate lines. This se

Re: [R] lw in legend also changes thickness of characters in the legend??

2008-05-14 Thread Deepayan Sarkar
On 5/14/08, Levi Waldron <[EMAIL PROTECTED]> wrote: > Here's a simple example: > > x <- 1:5 > plot(x,x^2) > lines(x,x^2) > points(x,x,cex=2) > lines(x,x,lw=3) > legend("topleft",legend=c("y=x^2","y=x"),pch=1,pt.cex=1:2,lw=c(1,3)) > > The thickness of the circles in the legend changes with lw

Re: [R] Can R handle large dataset?

2008-05-14 Thread Richard Rowe
Mingjun Huang wrote: Hello, I am new to R, can anyone give me an idea of how R handle a large dataset (e.g. couple of Gbytes)? Thanks a lot! In answer to your subject line: yes, not gigantic (multi-terrabyte), but large is likely to be OK. How depends on what you are trying to do.

Re: [R] is there any graphic function

2008-05-14 Thread Peter Alspach
Hanen arrows() will probably do what you want. It uses end points rather than midpoints. HTH . Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of hanen > Sent: Thursday, 15 May 2008 9:04 a.m. > To: r-help@r-project.org > Subject

Re: [R] win.graph() with more than one Lattice plot

2008-05-14 Thread Charilaos Skiadas
Deepayan's new book to the rescue again: http://lmdvr.r-forge.r-project.org/figures/figures.html? chapter=01;figure=01_04 Look at the code for this figure, especially the last two lines. Not sure that the fact that it's a win.graph device has much to do with this. Haris Skiadas Departmen

[R] is there any graphic function

2008-05-14 Thread hanen
hello: is there any graphic function under R that allow me to add an interval on the graphic's picture at any place i want. i mean by interval the symbol "||" showed verticaly and has as middle the point M with coordinates (yi,ti).please answer me as soon as possible. -- View this message i

Re: [R] win.graph() with more than one Lattice plot

2008-05-14 Thread Duncan Mackay
Paulo you can use the layout command if you use the plot command or using lattice viewports and grid.layout. I have not use layout or lattice equivalents for a while so am not upto date with correct syntax Regards Duncan Mackay Department of Agronomy and Soil Science University of New Engl

Re: [R] PC configuration you are using

2008-05-14 Thread Jonas Stein
> As I mentioned in the previous message we are developing solution for > wholesale companies to analyze their sales transactions by associative > rules. I would very much appreciated if the community could give us > some hint of what is a typical PC configuration of a professional > statist (proce

[R] howto get significant digits for round()

2008-05-14 Thread Jonas Stein
i have a table like this of an value and its tolerance length delta-length 12.2232 0.4 123.422 0.034123 1234 12 i want to round the value to the significant digits in this way: my-round(length,delta-length) 12.2 , 0.4 123.42 , 0.03 1234 , 12 how can i do this with R? please CC

[R] lw in legend also changes thickness of characters in the legend??

2008-05-14 Thread Levi Waldron
Here's a simple example: x <- 1:5 plot(x,x^2) lines(x,x^2) points(x,x,cex=2) lines(x,x,lw=3) legend("topleft",legend=c("y=x^2","y=x"),pch=1,pt.cex=1:2,lw=c(1,3)) The thickness of the circles in the legend changes with lw. If you change the lw argument in legend to lw=c(1,1) then the thickness of

[R] win.graph() with more than one Lattice plot

2008-05-14 Thread Paulo Cardoso
Is is possible to accomodate more than a single independent (not resulting from arranjment of layout=c()) lattice graphs in a single win.graph() device? Thanks in advance, PS Maybe duplicated Paulo De: [EMAIL PROTECTED] em nome de Roland Rau Enviada: qua 14-05

Re: [R] var function

2008-05-14 Thread Erik Iverson
See the 'variance' function in ifultools package. If you'd like the unbiased estimate of the variance, just use 'var' without the extra argument. Best, Erik Iverson Applejus wrote: Hello, I am trying to convert this splus line of code to R : var(outcome[1, ], unbiased = FALSE) It seems

Re: [R] Help to Draw Plot

2008-05-14 Thread ermimi
Patrick and Blay Thank you very much for help me, I have drawn in blue the axis Blay the solution that you give me for start in (-10,-10) and finish in (10,10) isn´t very well because I want that if my range is (-10,10) the axis is in -10,10. I need that there isn´t space between the less ran

[R] var function

2008-05-14 Thread Applejus
Hello, I am trying to convert this splus line of code to R : var(outcome[1, ], unbiased = FALSE) It seems the var function in R doesn't have the "unbiased" argument. Could someone help me figure the correct equivalent line in R? Thank you -- View this message in context: http://www.nabble

Re: [R] Cleaning up memory in R

2008-05-14 Thread Duncan Murdoch
On 5/14/2008 3:59 PM, Anh Tran wrote: I'm trying to work on a large dataset and after each segment of run, I need a command to flush the memory. I tried gc() and rm(list=ls()) but they don't seem to help. gc() does not do anything beside showing the memory usage. How do you know it does nothing

Re: [R] Help to Draw Plot

2008-05-14 Thread Blay
Try >par(fg="blue") >plot(range(10,-10),range(10,-10),col="blue",col.axis="blue",col.lab="blue",col.main="blue",col.sub="blue") Blay KATH ermimi wrote: > > Hello friends!! > > I have two questions, and I would like that you could answer me!!! > > I have created a plot as > > plot(range

Re: [R] Newbie question about vector matrix multiplication

2008-05-14 Thread apjaworski
Dan, You need to do diag(w) %*% as.matrix(co) %*% diag(w) The reason is that read.table creates a data frame. Although it looks like a matrix it is not - actually it is a special kind of list. The "as.matrix" function will coerce it to a matrix. By the way, this will generate m[i,j]=w[i]*co[

Re: [R] Cleaning up memory in R

2008-05-14 Thread Anh Tran
Sorry, it's the stupid mistake on my part. Please forgive that question. I have to unload the variable first. On Wed, May 14, 2008 at 1:12 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 5/14/2008 3:59 PM, Anh Tran wrote: > >> I'm trying to work on a large dataset and after each segment of r

Re: [R] Help to Draw Plot

2008-05-14 Thread Patrick Connolly
On Wed, 14-May-2008 at 09:12AM -0700, ermimi wrote: |> |> Hello friends!! |> |> I have two questions, and I would like that you could answer me!!! |> |> I have created a plot as |> |> plot(range(10,-10),range(10,-10),col="blue",col.axis="blue",col.lab="blue",col.main="blue",col.sub="blue")

Re: [R] Can R handle large dataset?

2008-05-14 Thread Julian Burgos
Depends on the RAM in your machine. And in your definition of 'handle'. You may be able to load a very large dataset into R, but won't be able to use some functions that require additional memory. A vague answer to a vague question... :) Julian Mingjun Huang wrote: Hello, I am new to

[R] Cleaning up memory in R

2008-05-14 Thread Anh Tran
I'm trying to work on a large dataset and after each segment of run, I need a command to flush the memory. I tried gc() and rm(list=ls()) but they don't seem to help. gc() does not do anything beside showing the memory usage. I'm using the package BSgenome from BioC. Thanks a bunch -- Regards,

Re: [R] Newbie question about vector matrix multiplication

2008-05-14 Thread Jeremiah Rounds
> Date: Wed, 14 May 2008 15:18:32 -0400 > From: [EMAIL PROTECTED] > To: r-help@r-project.org > Subject: [R] Newbie question about vector matrix multiplication > > Hello All, > > I have a covariance matrix, generated by read.table, and cov: > > co<-cov(read.table("c:/r.x")) > > X Y Z > > X 0.001

Re: [R] Accessing items in a list of lists

2008-05-14 Thread Dimitris Rizopoulos
check the following: sapply(comb, "[[", "a") # or data.frame( "names" = names(comb), "value" = sapply(comb, "[[", "a"), row.names = seq_along(comb) ) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuve

Re: [R] Accessing items in a list of lists

2008-05-14 Thread Sundar Dorai-Raj
[EMAIL PROTECTED] said the following on 5/14/2008 12:40 PM: Using R 2.6.2, say I have the following list of lists, "comb": data1 <- list(a = 1, b = 2, c = 3) data2 <- list(a = 4, b = 5, c = 6) data3 <- list(a = 3, b = 6, c = 9) comb <- list(data1 = data1, data2 = data2, data3 = data3) So that a

Re: [R] Accessing items in a list of lists

2008-05-14 Thread Tony Plate
Try this: > data1 <- list(a = 1, b = 2, c = 3) > data2 <- list(a = 4, b = 5, c = 6) > data3 <- list(a = 3, b = 6, c = 9) > comb <- list(data1 = data1, data2 = data2, data3 = data3) > sapply(comb, "[[", "a") data1 data2 data3 1 4 3 > # Also, this can be useful: > comb[[c("data2", "b")]

Re: [R] Newbie question about vector matrix multiplication

2008-05-14 Thread Dan Stanger
Hi Phil, That solved the problem. Thanks, Dan Stanger Eaton Vance Management 200 State Street Boston, MA 02109 617 598 8261 -Original Message- From: Phil Spector [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2008 3:42 PM To: Dan Stanger Subject: RE: [R] Newbie question about vector m

Re: [R] Accessing items in a list of lists

2008-05-14 Thread Henrique Dallazuanna
Try this: do.call(rbind, lapply(comb, '[', 'a')) On Wed, May 14, 2008 at 4:40 PM, <[EMAIL PROTECTED]> wrote: > Using R 2.6.2, say I have the following list of lists, "comb": > > data1 <- list(a = 1, b = 2, c = 3) > data2 <- list(a = 4, b = 5, c = 6) > data3 <- list(a = 3, b = 6, c = 9) > comb <

[R] Accessing items in a list of lists

2008-05-14 Thread nalbicelli
Using R 2.6.2, say I have the following list of lists, "comb": data1 <- list(a = 1, b = 2, c = 3) data2 <- list(a = 4, b = 5, c = 6) data3 <- list(a = 3, b = 6, c = 9) comb <- list(data1 = data1, data2 = data2, data3 = data3) So that all names for the lowest level list are common. How can I most

Re: [R] Newbie question about vector matrix multiplication

2008-05-14 Thread Dimitris Rizopoulos
try this: V <- var(matrix(rnorm(100*3), 100, 3)) w <- c(0.5, 0.3, 0.2) V * (w %o% w) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/

Re: [R] Newbie question about vector matrix multiplication

2008-05-14 Thread Dan Stanger
Hello Abhijit, When I try that, I get: > diag(w)%*%co%*%diag(w) Error in diag(w) %*% co : requires numeric matrix/vector arguments Dan Stanger Eaton Vance Management 200 State Street Boston, MA 02109 617 598 8261 -Original Message- From: Abhijit Dasgupta [mailto:[EMAIL PROTECTED] Sent: W

Re: [R] Newbie question about vector matrix multiplication

2008-05-14 Thread Abhijit Dasgupta
Won't diag(w)%*%co%*%diag(w) do it? Dan Stanger wrote: Hello All, I have a covariance matrix, generated by read.table, and cov: co<-cov(read.table("c:/r.x")) XYZ X 0.0012517684 0.0002765438 0.0007887114 Y 0.0002765438 0.0002570286 0.0002117336 Z 0.00078

[R] Newbie question about vector matrix multiplication

2008-05-14 Thread Dan Stanger
Hello All, I have a covariance matrix, generated by read.table, and cov: co<-cov(read.table("c:/r.x")) XYZ X 0.0012517684 0.0002765438 0.0007887114 Y 0.0002765438 0.0002570286 0.0002117336 Z 0.0007887114 0.0002117336 0.0009168750 And a weight vector ge

[R] Problems with step function

2008-05-14 Thread Ping Wang
Dear List Members, I have encountered two problems when using the step function to select models. To better illustrate the problems, an R image (step.add1.test.RData) which includes the objects needed to run the code (step.add1.test.R) can be found at www.biostat.wisc.edu/~pwang/r-help/

Re: [R] A very simple question

2008-05-14 Thread Julian Burgos
Try this: k=c(1,1,1,2,2,1,1,1) > k[(k!=1)] [1] 2 2 > k[(k!=2)] [1] 1 1 1 1 1 1 > k[(k!=3)] [1] 1 1 1 2 2 1 1 1 Julian Shubha Vishwanath Karanth wrote: Hi R, Suppose l=c(1,1,1,2,2,1,1,1) k[-which(k==1)] [1] 2 2 k[-which(k==2)] [1] 1 1 1 1 1 1 But, k[-which(k==3)]

Re: [R] Attributes or list programming "efficiency"

2008-05-14 Thread Gabor Grothendieck
The key difference is inheritance. Objects consisting of data frames with attributes, including a class attribute such as c("myclass", "data.frame), can inherit data frame methods but a list with a data frame component will require entirely new methods to be constructed for everything. On Wed,

Re: [R] Plotting Frequency Distribution in R

2008-05-14 Thread Sachin J
Thank you everyone for your help. I tried the following. Please let me know if I can use this method. df1$V2<-as.numeric(gsub("[%]","", df1[,2])) xbin <- binning(df1$V2,df1$V1,nbins=12) barplot(xbin$sums,xbin$x,xlab="V2",border = TRUE,ylab="V1",col="red") Thanks, Sachin - Original Message --

[R] Attributes or list programming "efficiency"

2008-05-14 Thread Bert Gunter
R-Fellow Travellers: Asked from the perspective of a software development amateur ... Suppose one wishes to create data structures that have both data and metadata -- e.g. a data.frame and details about where, when, and by whom the data were gathered (specifics not important here). 1. Is there

Re: [R] A very simple question

2008-05-14 Thread Greg Snow
Use logical subscripts rather than which: > k <- c(1,1,1,2,2,1,1,1) > k[ k != 1 ] [1] 2 2 > k[ k != 2 ] [1] 1 1 1 1 1 1 > k[ k != 3 ] [1] 1 1 1 2 2 1 1 1 Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -O

Re: [R] strip white in character strings

2008-05-14 Thread Roland Rau
Dear all, I would like to say thanks for the help of Mark Leeds (off-list), Jeremiah Rounds (off-list), and Jim Holtman. I will use the solution Mark and Jim provided using the gsub function. A bit embarrassing for me that I did not remember the function since I used it myself awhile ago. I

Re: [R] strip white in character strings

2008-05-14 Thread jim holtman
It depends on what you mean by striping the white space. Here is an example of how it might be done: > x <- c("United Kingdom", "Europe", "United States", "a longer string") > gsub(" +", "_", x) [1] "United_Kingdom" "Europe" "United_States" "a_longer_string" > On Wed, May 14

Re: [R] Can R handle large dataset?

2008-05-14 Thread Abhijit Dasgupta
I believe this is determined by how much memory your computer has, not particularly by R itself. Mingjun Huang wrote: Hello, I am new to R, can anyone give me an idea of how R handle a large dataset (e.g. couple of Gbytes)? Thanks a lot! Best, Mingjun ___

Re: [R] wavlet analysis

2008-05-14 Thread Julian Burgos
Hi Stephen, Your link doesn't work. In any case, check out the wavCWT function in the wmtsa package. Julian stephen sefick wrote: http://ion.researchsystems.com/cgi-bin/ion-p I would like a continuous wavelet transform. I have downloaded wavethresh, Rwave, and waveslim. I would like an ou

Re: [R] strip white in character strings

2008-05-14 Thread Scillieri, John
> a = " United Kingdom " > gsub( " ", "", a, fixed=TRUE ) [1] "UnitedKingdom" -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremiah Rounds Sent: Wednesday, May 14, 2008 12:48 PM To: '[EMAIL PROTECTED]' Subject: Re: [R] strip white in character strings

Re: [R] for loop, my program does not make a cycle

2008-05-14 Thread jim holtman
You got exactly what you were asking for: the value the last time through the loop. If you are trying to capture all 11 values, then you might consider a list: d<-as.vector(levels(a2$combin2)) a1 <- b1 <- vector('list',11) for (i in 1:11){ a1[[i]] <-a2[a2$combin2%in%d[i],] b1[[i]]<-b0[b0$Date%in%

Re: [R] Split a string of oneline into 2 lines.

2008-05-14 Thread A Ezhil
Thank you very much. It works ! Ezhil --- Uwe Ligges <[EMAIL PROTECTED]> wrote: > > > A Ezhil wrote: > > Hi, > > > > I am trying to split a string into 2 separate > strings > > in 2 lines. So, tried with > > > > sprintf("%s \n %s", "ID", "Name") > > > > But R prints: [1] "ID \n Name" instea

Re: [R] strip white in character strings

2008-05-14 Thread Jeremiah Rounds
> Date: Wed, 14 May 2008 12:06:39 -0400 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: [R] strip white in character strings > > Dear all, > > I have several datasets and I want to generate pdf plots from them. > I also want to generate automatically the names of the files. They ar

Re: [R] rlm and lmrob error messages

2008-05-14 Thread Dieter Menne
Susanne Komhard ise.fraunhofer.de> writes: > I'm using R2.7.0 (on Windows 2000) and I'm trying do run a robust > regression on following model structure: > > model = "Y ~ x1*x2 / (x3 + x4 + x5 +x6)" > > where x1 and x2 are both factors (either 1 or 0) and x3.x6 are numeric. > The error co

[R] Heatmap.2 - eliminate cluster and dendrogram

2008-05-14 Thread Peter Scacheri
Using the heatmap.2 function, I am trying to generate a heatmap of a 2 column x 500 row matrix of numeric values. I would like the 1st column of the matrix sorted from the highest to the lowest values - so that the colors reflected in the first column of the heatmap (top to bottom) go from red

[R] Can R handle large dataset?

2008-05-14 Thread Mingjun Huang
Hello, I am new to R, can anyone give me an idea of how R handle a large dataset (e.g. couple of Gbytes)? Thanks a lot! Best, Mingjun __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the post

[R] npmc and data.frame problems

2008-05-14 Thread Barbra C. Utley
Hello, I am trying to run a nonparametric comparison of multiple datasets (A-E). After importing my csv file I sorted the variable value by the letter class (representing height along a streambank). a=Z[Letter=="A"] b=Z[Letter=="B"] c=Z[Letter=="C"] d=Z[Letter=="D"] e=Z[Letter=="E"] Next

Re: [R] quantiles for dates

2008-05-14 Thread Dieter Menne
GOUACHE David arvalisinstitutduvegetal.fr> writes: > I was wondering if there is a package in which someone would have > created a quantile function that handles vectors of class "Date". Since dates are just decorated numbers, you can convert in both way. Written the long way: dt = rpois(100,1

Re: [R] Calling C code from R...wrapping C structures

2008-05-14 Thread Nathan Harmston
Hi, My function test is properly declared in the header file of the code: void test(Model *); and we just discovered yesterday we should be using .Call instead ,of .C. However we still can't get it to work. We arent trying to pass a primitive type from R but a complex one. We are trying to inter

[R] Help to Draw Plot

2008-05-14 Thread ermimi
Hello friends!! I have two questions, and I would like that you could answer me!!! I have created a plot as plot(range(10,-10),range(10,-10),col="blue",col.axis="blue",col.lab="blue",col.main="blue",col.sub="blue"); 1º) I want that the square of plot and the lines that indicates the value

Re: [R] strip white in character strings

2008-05-14 Thread pecardoso
Maybe another basic question but... Is is possible to accomodate more than a single (independent, not resulting from arranjment of layout=c()) lattice graph in a single win.graph() device? Thanks in advance, PS Maybe duplicated Paulo De: [EMAIL PROTECTED] e

Re: [R] Split a string of oneline into 2 lines.

2008-05-14 Thread Uwe Ligges
A Ezhil wrote: Hi, I am trying to split a string into 2 separate strings in 2 lines. So, tried with sprintf("%s \n %s", "ID", "Name") But R prints: [1] "ID \n Name" instead of ID Name Is it something I am missing here? Yes, in order to respect teh control character you have to cat()

[R] strip white in character strings

2008-05-14 Thread Roland Rau
Dear all, I have several datasets and I want to generate pdf plots from them. I also want to generate automatically the names of the files. They are country-specific and the element mycurrentdata[1,1] contains this information. So what I do is something like this: pdf(file=paste(mycurrentdata

Re: [R] console from tcltk

2008-05-14 Thread John Fox
Dear Brian and Gabor, When the Rcmdr "console.output" option is set to TRUE, the Rcmdr interface does something very much like this using cat() for R output, which it captures. The relevant code is in the doItAndPrint() function in the Rcmdr sources. I hope this helps, John > -Original Me

[R] Split a string of oneline into 2 lines.

2008-05-14 Thread A Ezhil
Hi, I am trying to split a string into 2 separate strings in 2 lines. So, tried with sprintf("%s \n %s", "ID", "Name") But R prints: [1] "ID \n Name" instead of ID Name Is it something I am missing here? Thanks in advance. Best regards, Ezhil __

Re: [R] PCA in Microarrays

2008-05-14 Thread Prof Brian Ripley
On Wed, 14 May 2008, Jorge Ivan Velez wrote: Dear useRs: I'm not sure if it's the correct place to ask but I'll try it out. I've been reading about how to perform Principal Component Analysis (PCA) in microarrays (see [1]) and there's something that I don't get it. Basically it's related with pe

Re: [R] Time differences (as.difftime?) issue

2008-05-14 Thread Prof Brian Ripley
On Wed, 14 May 2008, Lukas Rode wrote: Dear all, I have a vector generated using the function strptime: my.dt [1] "2004-04-19 08:35:00 W. Europe Daylight Time" "2004-04-19 09:35:00 W. Europe Daylight Time" "2004-04-19 11:35:00 W. Europe Daylight Time" [4] "2004-04-19 13:35:00 W. Europe Dayli

Re: [R] quantiles for dates

2008-05-14 Thread Gabor Grothendieck
Try this: > dd <- Sys.Date() + 1:10 > as.Date(quantile(as.numeric(dd)), origin = "1970-01-01") 0% 25% 50% 75% 100% "2008-05-15" "2008-05-17" "2008-05-19" "2008-05-21" "2008-05-24" On Wed, May 14, 2008 at 11:21 AM, GOUACHE David <[EMAIL PROTECTED]> wro

Re: [R] quantiles for dates

2008-05-14 Thread Prof Brian Ripley
On Wed, 14 May 2008, GOUACHE David wrote: Hello all, I was wondering if there is a package in which someone would have created a quantile function that handles vectors of class "Date". What is the median of today and tomorrow, expressed as a day? Quantiles of discrete distributions are not

Re: [R] console from tcltk

2008-05-14 Thread Gabor Grothendieck
Thanks. I've updated to the latest R on the mirror I used and puts stdout 12 from tcl does indeed produce output from Rterm on Windows but gives an error message from Rgui on Windows (both on Windows Vista SP1). - this works C:\tmp2>Rterm R version 2.7.0 Patched (2008-05-11 r45

Re: [R] A very simple question

2008-05-14 Thread Ingmar Visser
l[!l==3] On 14 May 2008, at 17:16, Shubha Vishwanath Karanth wrote: > Hi R, > > > > Suppose > > l=c(1,1,1,2,2,1,1,1) > > > > k[-which(k==1)] > > [1] 2 2 > > > > k[-which(k==2)] > > [1] 1 1 1 1 1 1 > > > > But, > > > > k[-which(k==3)] > > numeric(0) > > > > I do not want this numeric(0), instead t

Re: [R] A very simple question

2008-05-14 Thread Chuck Cleland
On 5/14/2008 11:16 AM, Shubha Vishwanath Karanth wrote: Hi R, Suppose l=c(1,1,1,2,2,1,1,1) k[-which(k==1)] [1] 2 2 k[-which(k==2)] [1] 1 1 1 1 1 1 But, k[-which(k==3)] numeric(0) I do not want this numeric(0), instead the whole k itself should be my result... How

Re: [R] A very simple question

2008-05-14 Thread Christos Hatzis
> k <- c(1,1,1,2,2,1,1,1) > k[k != 1] [1] 2 2 > k[k != 2] [1] 1 1 1 1 1 1 > k[k != 3] [1] 1 1 1 2 2 1 1 1 > -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Shubha > Vishwanath Karanth > Sent: Wednesday, May 14, 2008 11:16 AM > To: [EMA

[R] quantiles for dates

2008-05-14 Thread GOUACHE David
Hello all, I was wondering if there is a package in which someone would have created a quantile function that handles vectors of class "Date". In advance thanks. David Gouache ARVALIS - Institut du végétal Station de La Minière 78280 Guyancourt Tel: 01.30.12.96.22 / Port: 06.86.08.94.32 __

[R] A very simple question

2008-05-14 Thread Shubha Vishwanath Karanth
Hi R, Suppose l=c(1,1,1,2,2,1,1,1) k[-which(k==1)] [1] 2 2 k[-which(k==2)] [1] 1 1 1 1 1 1 But, k[-which(k==3)] numeric(0) I do not want this numeric(0), instead the whole k itself should be my result... How do I do this? Thanks, Shubha This e-mail may contai

[R] Time differences (as.difftime?) issue

2008-05-14 Thread Lukas Rode
Dear all, I have a vector generated using the function strptime: > my.dt [1] "2004-04-19 08:35:00 W. Europe Daylight Time" "2004-04-19 09:35:00 W. Europe Daylight Time" "2004-04-19 11:35:00 W. Europe Daylight Time" [4] "2004-04-19 13:35:00 W. Europe Daylight Time" "2004-04-20 07:50:00 W. Europe D

[R] for loop, my program does not make a cycle

2008-05-14 Thread J S
Dear R community, I wrote a small program using for loop but it does not make cycles. My data: Dataframes: a2, a1, b0 and b1. Vector: d I would like to get b1 for each of i., i.e. totally 11. However, the program gives me b1 only for the last i =11. d<-as.vector(levels(a2$combin2)) for (

Re: [R] console from tcltk

2008-05-14 Thread Prof Brian Ripley
I assume by 'console' you mean the Rgui window. That is not where stdout is connected -- it is not a file. As the CHANGES file for 2.7.0 says o When Rgui is launched from a terminal, C output from ill-formed packages that write to stdout or stderr rather than use Rprintf

[R] Parallel computing with rgenoud and snow: external file I/O possible?

2008-05-14 Thread Waichler, Scott R
I am trying to use rgenoud and snow with an external model and file I/O. Unlike the typical application of rgenoud and snow, I need to run an external executable and do pre- and post-processing of input and output files for each parameter set generated by genoud(). I'm hoping that someone can sugg

[R] PCA in Microarrays

2008-05-14 Thread Jorge Ivan Velez
Dear useRs: I'm not sure if it's the correct place to ask but I'll try it out. I've been reading about how to perform Principal Component Analysis (PCA) in microarrays (see [1]) and there's something that I don't get it. Basically it's related with performing PCA over data sets which number of vari

Re: [R] Likelihood between observed and predicted response

2008-05-14 Thread Ben Bolker
Christophe LOOTS ifremer.fr> writes: > > Hi, > > I've two fitted models, one binomial model with presence-absence data > that predicts probability of presence and one gaussian model (normal or > log-normal abundances). > > I would like to evaluate these models not on their capability of > a

[R] wavlet analysis

2008-05-14 Thread stephen sefick
http://ion.researchsystems.com/cgi-bin/ion-p I would like a continuous wavelet transform. I have downloaded wavethresh, Rwave, and waveslim. I would like an output very similar to the above website. any suggestions? -- Let's not spend our time and resources thinking about things that are so li

Re: [R] Dividing Two Dataframes

2008-05-14 Thread ONKELINX, Thierry
Dear Bert, Another option is to replicate SDF2 so the number of rows matches with those of SDF1. SDF1 <- data.frame(matrix(rnorm(144 * 2), nrow = 144)) SDF2 <- data.frame(matrix(rnorm(12 * 2), nrow = 12)) SDF1 / SDF2 #yields the error SDF2a <- do.call(rbind, rep(list(SDF2), nrow(SDF1) / nrow(SD

Re: [R] Dividing Two Dataframes

2008-05-14 Thread Greg Snow
SDF3 <- SDF1/SDF2[ rep(1:12,12), ] -Original Message- From: "Bert Jacobs" <[EMAIL PROTECTED]> To: "'Henrique Dallazuanna'" <[EMAIL PROTECTED]> Cc: "r-help@r-project.org" Sent: 5/14/08 7:41 AM Subject: Re: [R] Dividing Two Dataframes Hi Henrique, I think I understand your formula, bu

Re: [R] Dividing Two Dataframes

2008-05-14 Thread Bert Jacobs
Hi Henrique, I think I understand your formula, but your final result is a 12x160 data.frame, while it should be a 144x160 data.frame divide rows 1:12 with SDF2 (=12 rows) divide rows 13:24 with SDF2 (=12 rows) divide rows 25:36 with SDF2 (=12 rows) … divide rows 133:144 with SDF2 (=12

[R] rlm and lmrob error messages

2008-05-14 Thread Susanne Komhard
Hello all, I'm using R2.7.0 (on Windows 2000) and I'm trying do run a robust regression on following model structure: model = "Y ~ x1*x2 / (x3 + x4 + x5 +x6)" where x1 and x2 are both factors (either 1 or 0) and x3.x6 are numeric. The error code I get when running rlm(as.formula(model),

Re: [R] console from tcltk

2008-05-14 Thread Peter Dalgaard
Gabor Grothendieck wrote: > Is it possible to use the console from within tcltk? > > Not on Windows RGui, not without deeper magic, anyway (your examples work quite happily in a terminal on Linux). If you can figure out how to wire a Tcl channel to the R console, then I suppose it could be made

Re: [R] upperbound of C index Conf.int. greater than 1

2008-05-14 Thread Frank E Harrell Jr
DAVID ARTETA GARCIA wrote: Dear Frank Frank E Harrell Jr <[EMAIL PROTECTED]> wrote: A few observations. 1. With minimal overfitting, rcorr.cens(predict(fit), Y) gives a good standard error for Dxy = 2*(C-.5) and bootstrapping isn't very necessary 2. If you bootstrap use the nonparametric

Re: [R] Double y axes plot

2008-05-14 Thread Ben Bolker
Caio Azevedo gmail.com> writes: > How could I draw a plot with two y axes? For example, if I need too plot two > curves in the same graphic, which are measured in different scales. http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-base:2yaxes _

[R] Odp: R: Help with factors

2008-05-14 Thread Petr PIKAL
Hi so basically you want to 1. select one city 2. compute a correlation coeficient between value V for males and females 3. repeat this for each city As I am not an expert in statistics I could be off track but maybe cor(do.call(cbind,split(data$V, interaction(data$city, data$se

Re: [R] Double y axes plot

2008-05-14 Thread jim holtman
plot(...) par(new=TRUE) plot(...,axes=FALSE) On Wed, May 14, 2008 at 8:11 AM, Caio Azevedo <[EMAIL PROTECTED]> wrote: > Hi all, > > How could I draw a plot with two y axes? For example, if I need too plot > two > curves in the same graphic, which are measured in different scales. > > Thanks a lot

Re: [R] Negative Binomial Model

2008-05-14 Thread Achim Zeileis
On Wed, 14 May 2008, Mike Ryckman wrote: Hello, Thank you for your replies. I think that information largely focuses on robust standard errors... maybe I wasn't clear. No, you were not and, as pointed out previously (and described in the posting guide), a reproducible example would clearly h

[R] Double y axes plot

2008-05-14 Thread Caio Azevedo
Hi all, How could I draw a plot with two y axes? For example, if I need too plot two curves in the same graphic, which are measured in different scales. Thanks a lot in advance, Caio [[alternative HTML version deleted]] __ R-help@r-project.or

Re: [R] plotting different level of classficifaction

2008-05-14 Thread Jim Lemon
Oops, you will need: library(prettyR) to run the barhier function. Jim __ 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 commente

Re: [R] Negative Binomial Model

2008-05-14 Thread Mike Ryckman
Hello, Thank you for your replies. I think that information largely focuses on robust standard errors... maybe I wasn't clear. By default Stata parameterizes the dispersion. From the stata help files it is calculated as 1 + alpha*exp(xb + offset). As I understand it, this process should happen ou

Re: [R] plotting different level of classficifaction

2008-05-14 Thread Jim Lemon
jiho.han wrote: hello, useRs~ suppose i have a matrix as follows: itemcategory sub-category A 1 11 B 1 12 C 1 12 D 2 21 E 2 22 i like to draw

[R] Thanks! to my Very Simple Question

2008-05-14 Thread Yukihiro Ishii
Dear R Users! Thanks very much! I really don't know why the "scale" function didn't come to my mind when writing my silly question. But anyway thanks to all of you. Yukihiro Ishii 2-3-28 Tsurumakiminami, Hadano, 250-0002 Japan +81463691922 __ R-help@r-

Re: [R] Dividing Two Dataframes

2008-05-14 Thread Henrique Dallazuanna
Try this: DFS <- lapply(split(seq(1, 144, by = 1), rep(1:12, each = 12)), function(x)SDF1[x,]/SDF2) On Wed, May 14, 2008 at 5:02 AM, Bert Jacobs <[EMAIL PROTECTED]> wrote: > Hi, > > > > I have two dataframes one with 144 rows and 160 columns (SDF1) and one > with > 12 rows and 160 columns (SDF2)

Re: [R] lattice: left-aligned text in strips?

2008-05-14 Thread Charilaos Skiadas
On May 14, 2008, at 3:47 AM, RINNER Heinrich wrote: [adapted repost of question http://tolstoy.newcastle.edu.au/R/e4/help/08/03/6260.html] Dear R community, by default, text in the strips of a trellis plot is centered in the strip. Is there a way to have the text left-aligned? For example: l

[R] Odp: Help with factors

2008-05-14 Thread Petr PIKAL
Hi I am not sure what you want to do as you speak about using different function for different part of your data. > head(data) city year sex V 11 1975 F 25.3044 21 1975 M 16.5711 31 1976 M 16.6072 41 1976 F 24.2841 51 1977 M 14.8838 61 1977 F 24.8124

  1   2   >