[R] Loop struggle

2012-03-09 Thread titta majasalmi
Hi, I cannot get rid of this error message: Warning messages: 1: In if (data$SP == 1) { : the condition has length 1 and only the first element will be used 2: In if (data$SP == 1) { : the condition has length 1 and only the first element will be used 3: In if (data$SP == 1) { : the

Re: [R] Loop struggle

2012-03-09 Thread Chris Campbell
Hi Tiff data1 - data.frame(SP = c(2, 2, 1), A1 = 1:3) data1 SP A1 1 2 1 2 2 2 3 1 3 i - 1 data1$SP [1] 2 2 1 data1$SP[i] [1] 2 # a warning is generated when # the length of the argument is # greater than 1 if(c(TRUE, TRUE, TRUE)) print(TRUE) [1] TRUE Warning message: In if

Re: [R] Loop struggle

2012-03-09 Thread Petr PIKAL
Hi you are coming from different language paradigm? Although you did not provide your data I presume you have data frame called data with columns SP, A1-A5 Your construction data[1:n, A1]- data$A1 -1 seems to me rather strange and basically your cycle shall do

[R] time between two dates

2012-03-09 Thread carol white
Dear All, It may be a trivial question but how to determine the number of days between two dates? What I want to do is to subtract two dates by a function which returns the number of days between these two dates.  11.11.2008-11.11.2006 ~= 730 days Look forward to your reply, Carol

Re: [R] time between two dates

2012-03-09 Thread Sebastian Schubert
On 09/03/12 10:04, carol white wrote: Dear All, It may be a trivial question but how to determine the number of days between two dates? What I want to do is to subtract two dates by a function which returns the number of days between these two dates. 11.11.2008-11.11.2006 ~= 730 days

Re: [R] time between two dates

2012-03-09 Thread Berend Hasselman
On 09-03-2012, at 10:04, carol white wrote: Dear All, It may be a trivial question but how to determine the number of days between two dates? What I want to do is to subtract two dates by a function which returns the number of days between these two dates. 11.11.2008-11.11.2006 ~= 730

Re: [R] figure margins too large in RGtk2 drawing area as cairo device - why?

2012-03-09 Thread Mark Heckmann
Thanks, Peter. I did the following: restart R and run the same code with and without a minimal system pause (Sys.sleep) after the line that adds the device to the GTK window. Adding a pause will make it work, though I do not understand what is happening here. Note the different settings of

[R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread Hans Ekbrand
I need confint() for glm() to supress the messages Waiting for profiling to be done... because they mess up the caching mechanism of pgfSweave (see https://github.com/cameronbracken/pgfSweave/issues/40). I have read the help page of confint(), but I do not know how to get the help page for the

[R] rtags for VI(M)

2012-03-09 Thread Federico Calboli
Hi, according to the help file rtags does not support VI(M) yet. Is there any known hack to ctags to get tags for R in VI(M)? BW F -- Federico C. F. Calboli Neuroepidemiology and Ageing Research Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax

Re: [R] rpanel / list error

2012-03-09 Thread R. Michael Weylandt
Yes, please upload some code / data (minimal working example). The easiest way to upload data is to use dput() for a plain text representation. Also remember that the majority of R-Helpers don't use Nabble (rather they use an email client directly) so it's easier for us if you put things in the

Re: [R] From (common IDs different Names) To (common IDs common Names)

2012-03-09 Thread R. Michael Weylandt
library(stringr) x$Name - str_trim(gsub([ABC] Branch, ,x$Name)) Michael On Fri, Mar 9, 2012 at 12:32 AM, Sichong Chen csc...@gmail.com wrote: Dear Community I have a large dataframe x as follows with common ids but different names: x - data.frame(ID = c(1,1,2,2,2,3,3), + Name = c(B Branch

[R] R versus R Studio output differences

2012-03-09 Thread Aayush Raman
Hi Everyone, I ran the same code in R and in R-studio, but got two different results. Does anybody know why this is occurring, and if there is a fix for this? and which is the correct program to use ? Some information about the code I am running: I am running the fisher test and it seems that

Re: [R] R versus R Studio output differences

2012-03-09 Thread R. Michael Weylandt
Reproducible code please. (I'm quite surprised this would happen -- are you sure there's no stochastic element to your calculation that explains the differences?) But the canonical answer is the CLI R and the CRAN binaries. Michael On Fri, Mar 9, 2012 at 7:11 AM, Aayush Raman

Re: [R] Loop struggle

2012-03-09 Thread Petr PIKAL
Hi Hi, Ok I think I have to be more precise. Here is some example: The data includes tree samples (one of each species: 1, 2, 3 ) with different properties that are on rows. It is difficult to reproduce your code as the data can not be easily transferred to R. Better to use

Re: [R] SSOAP and Chemspider: Security token?

2012-03-09 Thread Stravs, Michael
Dear Duncan, thanks for the quick answer. However, I already sorted one error out - turned out that I was just stupid: The security token worked fine once I filled all the additional required information on the ChemSpider profile (which means the token showing up on your profile is

Re: [R] R versus R Studio output differences

2012-03-09 Thread peter dalgaard
On Mar 9, 2012, at 13:15 , R. Michael Weylandt wrote: Reproducible code please. (I'm quite surprised this would happen -- are you sure there's no stochastic element to your calculation that explains the differences?) Notice that the code is running on two separate platforms. It's not

Re: [R] R versus R Studio output differences

2012-03-09 Thread R. Michael Weylandt
Missed that...thank you. Michael On Fri, Mar 9, 2012 at 8:21 AM, peter dalgaard pda...@gmail.com wrote: On Mar 9, 2012, at 13:15 , R. Michael Weylandt wrote: Reproducible code please. (I'm quite surprised this would happen -- are you sure there's no stochastic element to your calculation

Re: [R] Extended Survival Plot Lines

2012-03-09 Thread Terry Therneau
... Is there a way to extend all the lines to make them end at a certain time point? (i.e outcome.[,1] is a time to event variable and I would like thesurvival lines on the plot to extend out to say 5(years) ) No, there is no option in the plot.survival function to do this. No one has

Re: [R] Copy dataframe for another

2012-03-09 Thread RMSOPS
Hello,     the idea is to copy the d for df, with new results. x-data.frame(name=x1,pos=4,age=20) x-rbind(x,data.frame(name=x2,pos=5,age=20)) x-rbind(x,data.frame(name=x3,pos=6,age=21)) x-rbind(x,data.frame(name=x4,pos=7,age=24)) x-rbind(x,data.frame(name=x5,pos=8,age=27))

Re: [R] find points on a graph

2012-03-09 Thread aoife
May i please update my question, and I understand now something that i did not yesterday. In this example: table - structure(c(4, 7, 0.2, 3, .1, 7, 222, 3, 10, 5, 11, 8, 8, 10, 7), .Dim = c(5L, 3L), .Dimnames = list(c(gene1, gene2, gene3, gene4, gene5), c(codon1, codon2, codon3)))

[R] For loop and using its index

2012-03-09 Thread Hassan Eini Zinab
Dear All, I have a data set with variables x1, x2, x3, ..., x20 and I want to create z1, z2, z3, ..., z20 with the following formula: z1 = 200 - x1 z2 = 200 - x2 z3 = 200 - x3 . . . z20 = 200 - x20. I tried using a for loop and its index as: for (i in 1:20) { z(i) = 200 - x(i) } But R gives

Re: [R] Plotting shaded areas

2012-03-09 Thread aoife
May I ask, is it possible using plotrix to shade a group of variables differentially from the rest of a graph, eg so the output looks similar to this, where the nodes of open circles are my nodes of interest: http://r.789695.n4.nabble.com/file/n4459137/Screen_shot_2012-03-08_at_12.18.34.png

Re: [R] rpanel / list error

2012-03-09 Thread jism7690
Hi Michael, Thank you for your reply. I have uploaded the minimum, I have left out the formulas for calculating the amounts as they are not important to the loop. Basically I have a while loop running that adds to the list of values and then outside this loop I have a list called sis, this is the

Re: [R] Calculating length of consecutive sequences within a vector

2012-03-09 Thread Jorge Molinos
Thanks, rle is what I was looking for. Jorge From: R. Michael Weylandt [michael.weyla...@gmail.com] Sent: 08 March 2012 16:29 To: Jorge Molinos Cc: r-help@R-project.org Subject: Re: [R] Calculating length of consecutive sequences within a vector rle

Re: [R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread sina rueeger
In stats:::confint.glm (actually it is MASS:::confint.glm) you see that the message() function is used to produce waiting for To avoid this message you can just use suppressMessages(confint(my.fit)) At least in R it works, hope it works with Sweave as well. Regards, Sina -- View this

Re: [R] parsing text files

2012-03-09 Thread jim holtman
Here is one way of doing it; it reads the file and create a 'long' version. ## input - file(/temp/ClinicalReports.txt, 'r') outFile - '/temp/output.txt' # tempfile() output - file(outFile, 'w') writeLines(ID, Date, variable, value, output) ID - NULL dataSw - NULL repeat{ line -

Re: [R] figure margins too large in RGtk2 drawing area as cairo device - why?

2012-03-09 Thread Michael Lawrence
Hi Mark, This comes down to the way that GTK+ allocates size to its widgets. The allocation of a widget is initialized to have a width and height of 1. When a child is added to a visible parent, the parent will execute its lay out algorithm and allocate a certain amount of space to the widget.

[R] sort dates

2012-03-09 Thread carol white
Hello, How is it possible to sort dates in R? Cheers, Carol __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] Copy dataframe for another

2012-03-09 Thread Petr PIKAL
Hi Hello, the idea is to copy the d for df, with new results. x-data.frame(name=x1,pos=4,age=20) x-rbind(x,data.frame(name=x2,pos=5,age=20)) x-rbind(x,data.frame(name=x3,pos=6,age=21)) x-rbind(x,data.frame(name=x4,pos=7,age=24)) x-rbind(x,data.frame(name=x5,pos=8,age=27))

Re: [R] For loop and using its index

2012-03-09 Thread Petr PIKAL
Hi Dear All, I have a data set with variables x1, x2, x3, ..., x20 and I want to create z1, z2, z3, ..., z20 with the following formula: z1 = 200 - x1 z2 = 200 - x2 z3 = 200 - x3 . . . z20 = 200 - x20. I tried using a for loop and its index as: for (i in 1:20) { z(i) =

Re: [R] sort dates

2012-03-09 Thread R. Michael Weylandt
? sort x - c(Sys.Date(), Sys.Date() + 1, Sys.Date() - 1) print(x) print(sort(x)) Michael On Fri, Mar 9, 2012 at 8:35 AM, carol white wht_...@yahoo.com wrote: Hello, How is it possible to sort dates in R? Cheers, Carol __

Re: [R] sort dates

2012-03-09 Thread Petr PIKAL
Hi Hello, How is it possible to sort dates in R? You mean sort? Or order? Something like: dd -sample(Sys.Date()-1:10) dd [1] 2012-03-04 2012-03-05 2012-02-29 2012-03-01 2012-03-02 [6] 2012-03-08 2012-03-03 2012-02-28 2012-03-06 2012-03-07 sort(dd) [1] 2012-02-28 2012-02-29 2012-03-01

Re: [R] sort dates

2012-03-09 Thread Robert Baer
How is it possible to sort dates in R? Try this: a = sample(as.Date(1:100, origin = '2012-01-01'),15) a [1] 2012-01-31 2012-01-22 2012-03-18 2012-03-05 2012-03-17 [6] 2012-03-08 2012-01-08 2012-01-20 2012-03-01 2012-03-21 [11] 2012-02-17 2012-01-17 2012-02-12 2012-02-28 2012-04-01 sort(a)

Re: [R] For loop and using its index

2012-03-09 Thread Milan Bouchet-Valat
Le vendredi 09 mars 2012 à 13:24 +0330, Hassan Eini Zinab a écrit : Dear All, I have a data set with variables x1, x2, x3, ..., x20 and I want to create z1, z2, z3, ..., z20 with the following formula: z1 = 200 - x1 z2 = 200 - x2 z3 = 200 - x3 . . . z20 = 200 - x20. I tried

Re: [R] sort dates

2012-03-09 Thread Gabor Grothendieck
On Fri, Mar 9, 2012 at 8:35 AM, carol white wht_...@yahoo.com wrote: Hello, How is it possible to sort dates in R? Your question has already been answered but note that if your data is a time series and you represent it using zoo it will automatically be sorted. Here dates is in reverse

Re: [R] Plotting shaded areas

2012-03-09 Thread R. Michael Weylandt
Perhaps ?polygon Michael On Fri, Mar 9, 2012 at 6:10 AM, aoife aoife.m.dohe...@gmail.com wrote: May I ask, is it possible using plotrix to shade a group of variables differentially from the rest of a graph, eg so the output looks similar to this, where the nodes of open circles are my nodes

Re: [R] R versus R Studio output differences

2012-03-09 Thread JLucke
First, be sure your R and the R associated with Rstudio are the same R versions. In Rstudio, check Tools - Options - R version. It looks as if your R-studio is running the 32-bit version of R. Aayush Raman ayushra...@gmail.com Sent by: r-help-boun...@r-project.org 03/09/2012 07:11 AM To

Re: [R] Boxplot Fill Pattern

2012-03-09 Thread Michael Friendly
On 3/8/2012 1:08 PM, Gabriel Yospin wrote: I would like to make a legible boxplot of tree growth rates for each of seven tree species at each of seven different sites. It's a lot of data to put on one figure, I know. I made a beautiful, interpretable figure using color, but my target journal

Re: [R] binning dates by decade for simulated data

2012-03-09 Thread David Winsemius
On Mar 8, 2012, at 7:37 PM, Jeff Garcia wrote: I have a simulated matrix of dates that I generated from a probability function. Each column represents a single iteration. I would like to bin each run _separately_ by decades and dump them into a new matrix where each column is the length

Re: [R] R-help Digest, Vol 109, Issue 9

2012-03-09 Thread Terry Therneau
On Fri, 2012-03-09 at 12:00 +0100, r-help-requ...@r-project.org wrote: A note on standard errors: ?S(t) +- std is a terrible confidence interval. ?You will be much more accurate if you use log scale. ?(Some argue for logit or log-log, in truth they all work well.) ? If n is large

Re: [R] Copy dataframe for another

2012-03-09 Thread RMSOPS
Hello Thanks for the reply. As yet I have not much experience in r, although I make some mistakes. Any tips to solve the problem of a more effective way. Regards -- View this message in context: http://r.789695.n4.nabble.com/Copy-dataframe-for-another-tp4456893p4459526.html Sent

Re: [R] Multiple Correspondence Analysis

2012-03-09 Thread Kevin E. Thorpe
You should send this to r-h...@stat.math.ethz.ch. On 03/09/2012 09:21 AM, Andrea Sica wrote: Hello everybody, I'm looking for someone who is able with MCA and would like to gives some help. If what I'm doing is not wrong, according to the purpose I have, I need to understand how to create

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-09 Thread Jan van der Laan
You could also have a look at the LaF package which is written to handle large text files: http://cran.r-project.org/web/packages/LaF/index.html Under the vignettes you'll find a manual. Note: LaF does not help you to fit 9GB of data in 4GB of memory, but it could help you reading your

Re: [R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread David Winsemius
On Mar 9, 2012, at 6:14 AM, Hans Ekbrand wrote: I need confint() for glm() to supress the messages I'm wondering if suppressMessages would be helpful? Which in turn suggests that you do not know how to use ??, so firt you should get in the habit of doing a helpSearch before posting.

Re: [R] Moving average with loess

2012-03-09 Thread Downey, Patrick
Hi Robert, If you type ?loess It pulls up the documentation. What about that function do you not like? As you said, it needs two variables, but typically the second is just your time index. Try this: n - 50 x - rep(0,n) for(i in 2:n){ x[i] - rnorm(1,x[i-1]) } loess(x ~ seq(1,n))

[R] Multiple Correspondence Analysis

2012-03-09 Thread Andrea Sica
Hello everybody, I'm looking for someone who is able with MCA and would like to gives some help. If what I'm doing is not wrong, according to the purpose I have, I need to understand how to create a dependence matrix, where I can analyze the dependence between all my variables. Till now this is

Re: [R] For loop and using its index

2012-03-09 Thread Petr Savicky
On Fri, Mar 09, 2012 at 01:24:00PM +0330, Hassan Eini Zinab wrote: Dear All, I have a data set with variables x1, x2, x3, ..., x20 and I want to create z1, z2, z3, ..., z20 with the following formula: z1 = 200 - x1 z2 = 200 - x2 z3 = 200 - x3 . . . z20 = 200 - x20. I tried

Re: [R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread Hans Ekbrand
On 2012-03-09 15:30, David Winsemius wrote: On Mar 9, 2012, at 6:14 AM, Hans Ekbrand wrote: I need confint() for glm() to supress the messages I'm wondering if suppressMessages would be helpful? Which in turn suggests that you do not know how to use ??, so firt you should get in the habit

[R] Simulating n 2x2 tables with the same odds ratio

2012-03-09 Thread hubinho
Hello. I'm looking for a method to simulate n different 2x2 tables having all the same odds ratio. For example. I need 100 tables with odds ratio 1 100 tables with odds ratio 2 100 tables with odds ratio 3 and so on. All tables should have the same marginal frequencies. Thank you -- View

Re: [R] Re : Moving average with loess

2012-03-09 Thread Faryabi, Robert (NIH/NCI) [F]
Thanks Pascal, The good new is the code works, but it doesn't produce the result that I expected, or at least it doesn't match what matlab does. I did a bit of search myself and came across the following post on stackoverflow http://stackoverflow.com/questions/7746529/smoothing-with-lowess

Re: [R] Simulating n 2x2 tables with the same odds ratio

2012-03-09 Thread Petr Savicky
On Fri, Mar 09, 2012 at 05:37:42AM -0800, hubinho wrote: Hello. I'm looking for a method to simulate n different 2x2 tables having all the same odds ratio. For example. I need 100 tables with odds ratio 1 100 tables with odds ratio 2 100 tables with odds ratio 3 and so on. All

[R] extracting the i-th row of a matrix in a list of lists

2012-03-09 Thread Benilton Carvalho
Hi, what is the proper of of passing a missing value so I can extract the entire i-th row of a matrix (in a list of lists) without pre-computing the number of cols? For example, if I know that the matrices have 2 columns, I can do the following: set.seed(1) x0 - lapply(1:10, function(i)

[R] Time series and logs.

2012-03-09 Thread Keith Weintraub
Folks, This is more of a stat question than an R question. Apologies in advance! Suppose I fit an AR(1) to a time-series and also fit an AR(1) to the logs of the same time-series and then simulate future paths. In my case I see a big difference in the resulting paths. If I simulate

Re: [R] rtags for VI(M)

2012-03-09 Thread Stefan Luedtke
Dear Federico, I am using the r-plugin provided for VIM on unix. This has an option of building tag files. http://www.vim.org/scripts/script.php?script_id=2628 I 've just tried the command, and albeit some error messages showed up, a tag file for the current dir was build. Not sure how the

[R] join 2 .sav

2012-03-09 Thread Sebastian Kruk
Dear R-users, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Copy dataframe for another

2012-03-09 Thread David Winsemius
On Mar 9, 2012, at 5:31 AM, RMSOPS wrote: Hello, the idea is to copy the d for df, with new results. x-data.frame(name=x1,pos=4,age=20) x-rbind(x,data.frame(name=x2,pos=5,age=20)) x-rbind(x,data.frame(name=x3,pos=6,age=21)) x-rbind(x,data.frame(name=x4,pos=7,age=24))

[R] layer plots.

2012-03-09 Thread aaral singh
Hello. I have 2 plots. plot1 -plot(table1) plot2 -plot(table2) How may i plot these both on the same graph, i.e. layer one graph on top of the other one. The result should look similar to this the image below, where the black lines indicate one plot, and the red dots indicate the second plot.

[R] reading HDF5 or H5 files

2012-03-09 Thread uday
I would like to read hdf5 or h5 files in R . I found two packages hdf5 and h5r , but in both packages they have information how to get attribute from data. In my case I would like see what kind of parameters are saved in every file. I have tried h5 -

[R] Create a list object in a loop

2012-03-09 Thread Aurelie Cosandey Godin
Dear all, I'm trying to create a list of point patterns ppp.object {spatstat} in a loop. My dataset looks like this: names(OT1);head(OT1);dim(OT1) [1] EID latitude longitude month year CPUE TSUM [8] fTSUM EID latitude longitude

Re: [R] Copy dataframe for another

2012-03-09 Thread David Winsemius
On Mar 9, 2012, at 10:41 AM, David Winsemius wrote: On Mar 9, 2012, at 5:31 AM, RMSOPS wrote: Hello, the idea is to copy the d for df, with new results. x-data.frame(name=x1,pos=4,age=20) x-rbind(x,data.frame(name=x2,pos=5,age=20)) x-rbind(x,data.frame(name=x3,pos=6,age=21))

Re: [R] layer plots.

2012-03-09 Thread R. Michael Weylandt
No idea what table1, table2 are plot(1:5, type = l) points(5:1, col = 2) should get you started. Michael On Fri, Mar 9, 2012 at 10:17 AM, aaral singh aaral.si...@gmail.com wrote: Hello. I have 2 plots. plot1 -plot(table1) plot2 -plot(table2) How may i plot these both on the same

Re: [R] Create a list object in a loop

2012-03-09 Thread Tal Galili
Hi Aurelie, Please give this a look: http://www.nealgroothuis.name/introduction-to-data-types-and-objects-in-r/ And see if this resolves most, or all, of your questions... Contact Details:--- Contact me: tal.gal...@gmail.com |

Re: [R] Create a list object in a loop

2012-03-09 Thread R. Michael Weylandt
You are overriding b at each loop iteration and consequently only keeping the last one. Perhaps b - list() for(i in sort(unique(OT1$month))){ a-OT1[OT1$month==i,] b[[i]]-ppp(a$longitude,a$latitude,marks=a$fTSUM,window=newW) plot(b[[i]],main=i) } Generally it's bad practice

Re: [R] layer plots.

2012-03-09 Thread aoife doherty
Many thanks for reply. I have trouble understanding how to use response, i am sorry. My question is i have two matrices. I then plot two matrices. Then I have 2 seperate plots. I can color the nodes in the plots in two different colors. Then, how do i merge the two plots to view one overlapping

Re: [R] Create a list object in a loop

2012-03-09 Thread Aurelie Cosandey Godin
Thank you Tal, useful link. Best, Aurelie On 2012-03-09, at 11:53 AM, Tal Galili wrote: Hi Aurelie, Please give this a look: http://www.nealgroothuis.name/introduction-to-data-types-and-objects-in-r/ And see if this resolves most, or all, of your questions... Contact

Re: [R] Create a list object in a loop

2012-03-09 Thread Aurelie Cosandey Godin
Thank you very much Michael! Best, Aurelie On 2012-03-09, at 11:56 AM, R. Michael Weylandt wrote: You are overriding b at each loop iteration and consequently only keeping the last one. Perhaps b - list() for(i in sort(unique(OT1$month))){ a-OT1[OT1$month==i,]

Re: [R] help please. 2 tables, which test?

2012-03-09 Thread Greg Snow
The chi-squared test is one option (and seems reasonable to me if it the the proportions/patterns that you want to test). One way to do the test is to combine your 2 matrices into a 3 dimensional array (the abind package may help here) and test using the loglin function. On Thu, Mar 8, 2012 at

Re: [R] xyplot without external box

2012-03-09 Thread Greg Snow
Why do you want to do this? Lattice was not really designed to put just part of the graph up, but rather to create the entire graph using one command. If you want to show a process, putting up part of a graph at a time, it may be better to create the whole graph as a vector graphics file (pdf,

Re: [R] help please. 2 tables, which test?

2012-03-09 Thread aoife doherty
Thank you. Can the chi-squared test compare two matrices that are not the same size, eg if matrix 1 is a 2 X 4 table, and matrix 2 is a 3 X 5 matrix? On Fri, Mar 9, 2012 at 4:37 PM, Greg Snow 538...@gmail.com wrote: The chi-squared test is one option (and seems reasonable to me if it the the

Re: [R] How to sort frequency distribution table?

2012-03-09 Thread Greg Snow
R tends to see the ordering of factor levels as a property of the data rather than a property of the table/graph. So it is generally best to modify the data object (factor) to represent what you want rather than look for an option in the table/plot function (this will also be more efficient in

Re: [R] xyplot without external box

2012-03-09 Thread David Winsemius
On Mar 8, 2012, at 8:02 AM, Mauricio Zambrano-Bigiarini wrote: Dear list members, Within a loop, I need to create an xyplot with only a legend, not even with the default external box drawn by lattice. I already managed to remove the axis labels and tick marks, but I couldn't find in the

Re: [R] xyplot without external box

2012-03-09 Thread David Winsemius
On Mar 9, 2012, at 12:10 PM, David Winsemius wrote: On Mar 8, 2012, at 8:02 AM, Mauricio Zambrano-Bigiarini wrote: Dear list members, Within a loop, I need to create an xyplot with only a legend, not even with the default external box drawn by lattice. I already managed to remove the

Re: [R] help please. 2 tables, which test?

2012-03-09 Thread R. Michael Weylandt
You should probably read up on what the chi-squared test actually tests: in one form, it asks whether some set of observations could have come from a given multinomial distribution. Concretely, it asks whether it is reasonable to get 3 blues, 4 reds, and 2 whites from a uniform distribution over

Re: [R] layer plots.

2012-03-09 Thread R. Michael Weylandt
Do your matrices match up with each other in any meaningful way or do you just want two independent plots on a single page? You should probably provide the dput() output of each table object so we can see what you've got. Michael On Fri, Mar 9, 2012 at 11:07 AM, aoife doherty

Re: [R] help please. 2 tables, which test?

2012-03-09 Thread S Ellison
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of aoife doherty Thank you. Can the chi-squared test compare two matrices that are not the same size, eg if matrix 1 is a 2 X 4 table, and matrix 2 is a 3 X 5 matrix? No.

[R] what does rlm do if it fails to converge within iteration limits?

2012-03-09 Thread Michael
Hi all, In using rlm I've got a bunch of warnings... failed to converge in 20 steps, etc. My question is: what are the results then after the failure? Will rlm automatically downgrade back to lm upon failure? Thanks a lot! [[alternative HTML version deleted]]

[R] Removing Values from Summary after Survival Curve

2012-03-09 Thread mtkent189
Hi All, s = Surv(outcome.[,1], outcome.[,2]) survplot= (survfit(s ~ person.list[,1])) summary(survplot) This prints a summary of all the curves at specified time intervals of events. Is there a way to suppress this summary to only display a

Re: [R] layer plots.

2012-03-09 Thread aaral singh
The response much appreciated. They do match up, one is a small subset of the other. I have this: dput(table1) structure(list(var1 = c(2L, 4L, 4L, 1L, 423L), var2 = c(3L, 5L, 6L, 342L, 3L)), .Names = c(var1, var2), class = data.frame, row.names = c(node1, node2, node3, node4, node5))

Re: [R] For loop and using its index

2012-03-09 Thread chuck.01
Hassan, Others have provided you with better solutions, but I hope this allows you to see why yours didn't work. # first (going with your code) you needed a data.frame called x # here is an example: x - structure(list(x1 = c(0.0986048226696643, -0.445652024980979, 0.0893989676314604,

[R] socket connection in while(TRUE) loop the best way?

2012-03-09 Thread cory n
I'm accessing R via a socket connection. I set up a connection using socketConnection and then use readLines inside of a while(TRUE) loop to listen for activity. Is that the best way of doing this sort of activity? It works, that's not the issue, I am just wondering if there's a better way.

Re: [R] extracting the i-th row of a matrix in a list of lists

2012-03-09 Thread cberry
Benilton Carvalho beniltoncarva...@gmail.com writes: Hi, what is the proper of of passing a missing value so I can extract the entire i-th row of a matrix (in a list of lists) without pre-computing the number of cols? For example, if I know that the matrices have 2 columns, I can do the

Re: [R] what does rlm do if it fails to converge within iteration limits?

2012-03-09 Thread Berend Hasselman
On 09-03-2012, at 20:00, Michael wrote: Hi all, In using rlm I've got a bunch of warnings... failed to converge in 20 steps, etc. My question is: what are the results then after the failure? They haven't converged. So inaccurate. Maybe your model is badly formulated or ill

[R] rgl: cylinder3d() with elliptical cross-section

2012-03-09 Thread Michael Friendly
For a paper dealing with generalized ellipsoids, I want to illustrate in 3D an ellipsoid that is unbounded in one dimension, having the shape of an infinite cylinder along, say, z, but whose cross-section in (x,y) is an ellipse, say, given by the 2x2 matrix cov(x,y). I've looked at

Re: [R] No announcement of version 2.14.2

2012-03-09 Thread Uwe Ligges
Thanks, we will try to get it updated soon. Uwe On 08.03.2012 09:40, Caitlin wrote: Hi all. I just noticed that the release of version 2.14.2 was not announced on the R home page. Thanks, ~Caitlin [[alternative HTML version deleted]] __

Re: [R] hierarchical clustering of large dataset

2012-03-09 Thread Uwe Ligges
I think the main issue of the OP is that he geneartes a 55000x55000 distance matrix and has to calculate on it. Beside immense main memory consumption this may take ages to complete with hierarchical clustering. Uwe Ligges On 08.03.2012 15:02, Sarah Goslee wrote: See inline: On Thu, Mar 8,

Re: [R] Where do I report CRAN mirror problems?

2012-03-09 Thread Uwe Ligges
Seems to be fine for me. Uwe Ligges On 07.03.2012 03:24, Robert King wrote: Where should I report mirror problems? There doesn't seem to be anywhere on http://cran.r-project.org/mirrors.html listing contact emails for mirror admins. There is some problem with the debian binaries on

[R] qbeta function in R

2012-03-09 Thread Anamika Chaudhuri
HI All: Does anyone know the code behind the qbeta function in R? I am using it to calculate exact confidence intervals and I am getting 'NaN' at places I shouldnt be. Heres the simple code I am using: k-3 x-NULL p-rbeta(k,3,3)# so that the mean nausea rate is alpha/(alpha+beta) min-10

Re: [R] qbeta function in R

2012-03-09 Thread David Winsemius
On Mar 9, 2012, at 2:48 PM, Anamika Chaudhuri wrote: HI All: Does anyone know the code behind the qbeta function in R? Well, yes, but don't you think it would be wise to question whether your code might be the problem rather than the R code? I am using it to calculate exact confidence

Re: [R] qbeta function in R

2012-03-09 Thread William Dunlap
Take a look at n-x+1, the second parameter to the beta distribution: n - c(10, 45, 38) x - rbind(c( 7, 45, 31), +c(10, 40, 35), +c( 9, 44, 33), +c( 8, 44, 31), +c( 8, 45, 36)) n - x + 1 [,1] [,2] [,3] [1,]4 -6 15 [2,] 36 -294

Re: [R] index instead of loop?

2012-03-09 Thread Ben quant
Here is my latest. I kind of changed the problem (for speed). In real life I have over 300 uadata type matrices, each having over 20 rows and over 11,000 columns. However the rddata file is valid for all of the uadata matrices that I have (300). What I am doing now: I'm creating a matrix of row

Re: [R] hierarchical clustering of large dataset

2012-03-09 Thread Sarah Goslee
2012/3/9 Uwe Ligges lig...@statistik.tu-dortmund.de: I think the main issue of the OP is that he geneartes a 55000x55000 distance matrix and has to calculate on it. Beside immense main memory consumption this may take ages to complete with hierarchical clustering. Indeed. I missed that in the

Re: [R] hierarchical clustering of large dataset

2012-03-09 Thread Peter Langfelder
On Thu, Mar 8, 2012 at 4:41 AM, Massimo Di Stefano massimodisa...@gmail.com wrote: Hello All, i've a set of observations that is in the form : a,    b,    c,    d,    e,    f 67.12,    4.28,    1.7825,    30,    3,    16001 67.12,    4.28,    1.7825,    30,    3,    16001 66.57,    4.28,  

Re: [R] layer plots.

2012-03-09 Thread ilai
It's hard to help if you keep changing the framework of your problem, first two matrices - now it's a data.frame and a list of subset row names in a plotting method from whatever package suprow comes from. Regardless, Michael's original answer already gave you a solution:

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

2012-03-09 Thread Daniel Malter
#The code of rank 1 in the previous post should have read #rank1-apply(iterator1,1,function(x) x+base1) #corrected code below siegel.tukey=function(x,y,id.col=TRUE,adjust.median=F,rnd=-1,alternative=two.sided,mu=0,paired=FALSE,exact=FALSE,correct=TRUE,conf.int=FALSE,conf.level=0.95){

Re: [R] extracting the i-th row of a matrix in a list of lists

2012-03-09 Thread Benilton Carvalho
Hi Chuck, thank you *very* much! That really helped! b On 9 March 2012 17:15, cbe...@tajo.ucsd.edu wrote: Benilton Carvalho beniltoncarva...@gmail.com writes: Hi, what is the proper of of passing a missing value so I can extract the entire i-th row of a matrix (in a list of lists) without

[R] round giving different results on Windows and Mac

2012-03-09 Thread Ruth Ripley
Dear all, I have been running some tests of my package RSiena on different platforms and trying to reconcile the results. With Mac, the commands options(digits=4) round(1.81652, digits=4) print 1.817 With Windows, the same commands print 1.816 I am not bothered which answer I get, but it

[R] nonparametric densities for bounded distributions

2012-03-09 Thread Max Kuhn
Can anyone recommend a good nonparametric density approach for data bounded (say between 0 and 1)? For example, using the basic Gaussian density approach doesn't generate a very realistic shape (nor should it): set.seed(1) dat - rbeta(100, 1, 2) plot(density(dat)) (note the area outside of

Re: [R] hierarchical clustering of large dataset

2012-03-09 Thread Massimo Di Stefano
Peter, really thanks for your answer. install.packages(flashClust) library(flashClust) data - read.csv('/Users/epifanio/Desktop/cluster/x.txt') data - na.omit(data) data - scale(data) mydata a bc d e 1 -0.207709346 -6.618558e-01

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

2012-03-09 Thread Tal Galili
With coordination with the code's author (Daniel), The updated code has been uploaded to github here: https://github.com/talgalili/R-code-snippets/blob/master/siegel.tukey.r And also the following post was updated with the code:

[R] Interacting with the Operating System

2012-03-09 Thread Julio Sergio
Is there any way to issue operating system commands and geting back the results, in R? I mean, for instance, in Linux, to execute from R the 'ls' command and getting back a list of files in the current directory, or, equivalently, in Windows/DOS, the 'dir' command? I'm not interested in the

  1   2   >