Re: [R] Plotting Frequency Distribution in R

2008-05-14 Thread tony.sun
x - read.table(textConnection( V1 V2 1 1 160.54% 2 1 201.59% 3 1 18.45% 4 1 179.03% 5 1 274.37% 6 1 0.00% 7 1 24.52% 8 1 39.17% 9 3 43.72% 10 1 53.06% 11 1 64.97% 12 1 79.84% 13 1 98.08% 14 1 115.32% 15 1 127.96% 16 1 155.38% 17 1 157.25% 18 1 193.17%

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

2008-05-14 Thread RINNER Heinrich
[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: library(lattice) test - data.frame(x=rnorm(100),

Re: [R] For Social Network Analysis-Graph Analysis - How to convert 2 mode data to 1 mode data?

2008-05-14 Thread Gabor Csardi
Hi Solomon, On Tue, May 13, 2008 at 05:53:44PM -0400, Messing, Solomon O. wrote: Hi Gabor, Thank you for your help, and thanks for making the excellent igraph package. The function below seems not generate an edge list that works for my data. I coerced a my data from a data frame using

[R] Dividing Two Dataframes

2008-05-14 Thread Bert Jacobs
Hi, I have two dataframes one with 144 rows and 160 columns (SDF1) and one with 12 rows and 160 columns (SDF2). Now I'm trying to divide rows 1:12 with SDF2, rows 13:24 with SDF2, rows 25:36 with SDF 2, . In S-Plus the following code works fine: DFS = SDF1[1:144,1:60] /

Re: [R] For Social Network Analysis-Graph Analysis - How to convert 2 mode data to 1 mode data?

2008-05-14 Thread Gabor Csardi
Please stay on the list. On Tue, May 13, 2008 at 06:05:15PM -0400, Messing, Solomon O. wrote: Gabor, By the way, this seems to work: I'm a bit lost. So now you're converting your data frame to a matrix? Why? Or you're doing the two-mode to one-mode conversion here? It does not seem so to

Re: [R] The try() function with read.delim().

2008-05-14 Thread Martin Maechler
RT == Rolf Turner [EMAIL PROTECTED] on Wed, 14 May 2008 13:12:02 +1200 writes: RT I have written a function which reads data from files using read.delim RT (). RT The names of these files are complicated and are built using arguments RT to the wrapper function. Since the

[R] Predictive Analytics event June 5-6, NYC

2008-05-14 Thread Elise Johnson
Hi, I wanted to make sure you were all aware of this upcoming event. There is one remaining spring seminar in Predictive Analytics, on June 5-6 in New York City. This is intensive training for managers, marketers, and IT people who need to make sense of customer data to predict buying behavior,

Re: [R] The try() function with read.delim().

2008-05-14 Thread Martin Maechler
Oops, there where some typos / thinkos in my post, in the more sophisticated tryCatch() example. I append the full message with corrected example. -- Martin --- RT == Rolf Turner [EMAIL PROTECTED] on Wed, 14 May 2008 13:12:02

Re: [R] Negative Binomial Model

2008-05-14 Thread Ted Harding
On 14-May-08 09:11:31, Achim Zeileis wrote: On Wed, 14 May 2008, Mike Ryckman wrote: Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I get from the Stata nbreg command. I've tried a few different options but haven't

[R] Negative Binomial Model

2008-05-14 Thread Mike Ryckman
Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I get from the Stata nbreg command. I've tried a few different options but haven't had much luck. The closest I've found is: gamlss(formula, family = NBI, sigma.formula = ~

Re: [R] Negative Binomial Model

2008-05-14 Thread Achim Zeileis
On Wed, 14 May 2008, Mike Ryckman wrote: Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I get from the Stata nbreg command. I've tried a few different options but haven't had much luck. The closest I've found is:

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

2008-05-14 Thread DAVID ARTETA GARCIA
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 bootstrap percentile method

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

2008-05-14 Thread Ramon Diaz-Uriarte
Dear Nathan, How is you C function test defined? What type of argument is it expecting? The mappings between R and C type of arguments you can pass is explained in: http://cran.r-project.org/doc/manuals/R-exts.html#Interface-functions-_002eC-and-_002eFortran which also provides some examples.

Re: [R] R benchmarking program

2008-05-14 Thread Martin Maechler
PhGr == Philippe Grosjean [EMAIL PROTECTED] on Tue, 13 May 2008 16:10:15 +0200 writes: PhGr Hello, PhGr I did this bechmark test. Perhaps is it a good oppotunity to rewrite it PhGr and make it compatible with R 2.7.0, David? I'll not really rewrite it (to make it nice in my

Re: [R] R benchmarking program

2008-05-14 Thread Philippe Grosjean
Martin Maechler wrote: PhGr == Philippe Grosjean [EMAIL PROTECTED] on Tue, 13 May 2008 16:10:15 +0200 writes: PhGr Hello, PhGr I did this bechmark test. Perhaps is it a good oppotunity to rewrite it PhGr and make it compatible with R 2.7.0, David? I'll not really rewrite it

[R] dataframes to a list

2008-05-14 Thread Shubha Vishwanath Karanth
Hi R, I have the data frames, data1, data2data50. Now I want to put all of these in a single list. But, list(data1, data2,.data50) is very big to write. How do I then do it? Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}}

Re: [R] dataframes to a list

2008-05-14 Thread Shubha Vishwanath Karanth
How do I proceed from this stage? paste(data,1:10,sep=,collapse=,) Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

[R] Help with factors

2008-05-14 Thread Serguei Kaniovski
Hallo All, I have difficulties understanding how factors work in R. Suppose a have data in the panel form below. I would to compute a correlation coefficient (actually apply a different function of two time series) in the V variable between members of the two sexes in each city over time. How

Re: [R] dataframes to a list

2008-05-14 Thread Matthias Kohl
Does mget(paste(data, 1:50, sep = ), envir = globalenv()) give what you want? hth, Matthias Shubha Vishwanath Karanth wrote: How do I proceed from this stage? paste(data,1:10,sep=,collapse=,) Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo *

Re: [R] R benchmarking program

2008-05-14 Thread Martin Maechler
MM == Martin Maechler [EMAIL PROTECTED] on Wed, 14 May 2008 12:05:00 +0200 writes: PhGr == Philippe Grosjean [EMAIL PROTECTED] on Tue, 13 May 2008 16:10:15 +0200 writes: PhGr Hello, PhGr I did this bechmark test. Perhaps is it a good oppotunity to rewrite it PhGr and

[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

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:

[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 __

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

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

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). Now

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

[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]] __

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

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 in

[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,

Re: [R] Double y axes plot

2008-05-14 Thread Ben Bolker
Caio Azevedo cnaberdl at 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

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 to

[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] 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] 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

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 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

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) /

[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

Re: [R] Likelihood between observed and predicted response

2008-05-14 Thread Ben Bolker
Christophe LOOTS Christophe.Loots at 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

[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

[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

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] 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

[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 Daylight

[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

[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

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: [EMAIL

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...

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 the whole k itself should be my

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:\tmp2Rterm R version 2.7.0 Patched (2008-05-11

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] 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 Daylight

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

[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] 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

[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:

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() it as

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]

[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] 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

Re: [R] quantiles for dates

2008-05-14 Thread Dieter Menne
GOUACHE David D.GOUACHE at 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 =

[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 I tested

[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

[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

Re: [R] rlm and lmrob error messages

2008-05-14 Thread Dieter Menne
Susanne Komhard susanne.komhard at 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

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 are

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 instead of ID Name Is it

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],]

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] 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

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] 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, 2008 at 12:06 PM,

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.

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

[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] 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 From:

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] 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)]

[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

[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

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:

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:

[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] 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 - list(data1

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

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)]] [1] 5 [EMAIL

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 all

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 Leuven Address:

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.0012517684

[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] 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

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); | | | 1º) I

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

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

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

[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:

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

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

[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

  1   2   >