[R] Cumulative distribution of Spearman's Rank rho values.

2011-12-27 Thread ali_protocol
Hi every one, newbie here. I have a matrix and I want to compute the cumulative distribution of Spearman's Rank rho values, for variables (which are in rows) m= matrix ( rnorm (30), 10,3) how is that done? -- View this message in context:

[R] Longitudinal data

2011-12-27 Thread Silvano
Hi, I'm analyzing a longitudinal data set with 387 cows were observed in 63 days divided into 6 groups, and every 30 days was found to produce milk. Does not aim to model the time using regression. Only compare the groups differ in terms of milk production. There are many missing

Re: [R] comparing fields within a record

2011-12-27 Thread Jorge I Velez
Try also subset(x, as.Date(Inspected, %m/%d/%y) as.Date(Sold, %m/%d/%y) ) HTH, Jorge.- On Mon, Dec 26, 2011 at 9:32 PM, Jorge I Velez wrote: Hi Eric, Try # data x - structure(list(House_number = 1:4, Inspected = structure(c(3L, 4L, 1L, 2L), .Label = c(10/31/2011, 8/3/2011, 9/2/2011,

[R] How to extract an interval of hour:minute type

2011-12-27 Thread ikuzar
Hi, I 'd like to know how to extract an interval of hour:minute type from a column of POSIXlt POSIXct type. For instance: my_data.csv: 4352;2011-09-02 21:30:00;3242; 4352;2011-09-02 21:31:00;3315; 4352;2011-09-02 21:32:00;4241; 4352;2011-09-02 21:33:00;5394; ... 4352;2011-09-02

[R] multiple log-rank test for adjusted P value

2011-12-27 Thread Elliott
Hello R users: I wonder if there are functions for multiple log-rank tests with adjusted P-values. I found survdiff( ) only give pooled tests but without pairwise ones. Thanks a lot ! best wishes zhang zihong -- View this message in context:

Re: [R] Zero-inflated Negative Binomial Error

2011-12-27 Thread Achim Zeileis
As Ben pointed out, this is not reproducible. My guess is that the offending sample is degenerate in some way, e.g., there are no observations in one of the six sites or no non-zero responses. hth, Z On Mon, 26 Dec 2011, Melissa Aikens wrote: Hello, I am having a problem with the

Re: [R] Problem with RCOM package

2011-12-27 Thread KUMAR
Hi, Thank you for the response, I had indeed not installed statconnDCOM. Now able to invoke methods of the com object. Also have joined the mailing list rco...@mailman.csd.univie.ac.at. Now I am trying to capture the callback events fired by my com object. Have posted the question on the

[R] is there any multiple log-rank tests function with adjusted P-value implemented ?

2011-12-27 Thread Cheung Zihong
Hello R users: I wonder if any function are available for multiple log-rank tests with adjusted P-values. I found survdiff( ) only give pooled tests but without pairwise ones. Thanks a lot ! best wishes zhang zihong [[alternative HTML version deleted]]

Re: [R] rbinom

2011-12-27 Thread peter dalgaard
On Dec 27, 2011, at 15:47 , Scott Raynaud wrote: I have the following code (which I did not write) that generates data based on a logistic model. I'm only getting a single record with y=1. It seems implausible that in 50k cases that have a single y=1. Does that ring alarm bells for

[R] function to create Pango markup?

2011-12-27 Thread Mark Heckmann
Im am looking for a function to create Pango markups (by e.g. passing a string and a set of Pango markup attributes like color etc.) Is there a function that will do this? Thanks! Mark Heckmann Blog: www.markheckmann.de R-Blog: http://ryouready.wordpress.com

Re: [R] comparing fields within a record

2011-12-27 Thread Eric Wolff
I should have said, those date vairable are indeed date variables, but I'll try some of these techniques as soon as I get in this morning. Thanks so much for your input. - Eric On Tue, Dec 27, 2011 at 6:54 AM, Jorge I Velez jorgeivanve...@gmail.comwrote: Try also subset(x,

[R] helpful functions in R for testing results of tree (party)

2011-12-27 Thread seanstclair
Hello all. I have been teaching myself how to use recursive partitioning in R, particularly using the party package. Now that i've generated some trees, i would like to understand how i would go about validating the goodness of fit/accuracy, etc..., of the trees. What

[R] How to create a matrix with 3 dimensions from several 2 dimensional matrice?

2011-12-27 Thread ali_protocol
Hi every one, How is it possible to create a matrix with 3 dimensions from several 2 dimensional matrice? Is it possible that each of elementary/building block matrices could be called by its corresponding original name? Thanks alot. -- View this message in context:

Re: [R] Rhelp-gmm

2011-12-27 Thread Uwe Ligges
On 27.12.2011 15:43, 木棉 wrote: Dear friend, Hello! When I’m using R, I come across some problems. Could you please give me a hand? Attached is my problem in details. Thanks a lot! PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

Re: [R] Summary tables of large datasets including character and numerical variables

2011-12-27 Thread John Kane
A function like the one below will give you the class and number of valid entries for a dataset.  At sample data set would help determine if it works. It works on a simple data set I created and one from the ggplot2 package but it is not really tested. With your data set as df1 something like

Re: [R] Long jobs completing without output

2011-12-27 Thread Uwe Ligges
On 23.12.2011 14:54, Brendan Halpin wrote: I've been running a glmer logit on a very large data set (600k obs). Running on a 10% subset works correctly, but for the complete data set, R completes apparently without error, but does not display the results. Given these jobs take about 200

Re: [R] How to extract an interval of hour:minute type

2011-12-27 Thread jim holtman
Here is one way: x - read.table(text = 4352;2011-09-02 21:30:00;3242; + 4352;2011-09-02 21:31:00;3315; + 4352;2011-09-02 21:32:00;4241; + 4352;2011-09-02 21:33:00;5394;, sep = ';', as.is = TRUE) # create a 'character' of just the time. If the data is of # the format above, 'substring' can be

Re: [R] Longitudinal data

2011-12-27 Thread Uwe Ligges
On 27.12.2011 14:43, Silvano wrote: Hi, I'm analyzing a longitudinal data set with 387 cows were observed in 63 days divided into 6 groups, and every 30 days was found to produce milk. Does not aim to model the time using regression. Only compare the groups differ in terms of milk production.

Re: [R] help with xyplot

2011-12-27 Thread David Winsemius
On Dec 27, 2011, at 8:38 AM, Ayyappa Chaturvedula wrote: Dear group, I am trying to plot individual plots of TIME vs DV using xyplot. I used the following code: xyplot(DV~TIME|CID,data=gendiff,layout=c(4,4,20)) It works fine but the problem is that the plot is not saving all the pages,

[R] help with xyplot

2011-12-27 Thread Ayyappa Chaturvedula
Dear group, I am trying to plot individual plots of TIME vs DV using xyplot. I used the following code: xyplot(DV~TIME|CID,data=gendiff,layout=c(4,4,20)) It works fine but the problem is that the plot is not saving all the pages, I could see only the 20th page. How to make all the pages

Re: [R] multiple log-rank test for adjusted P value

2011-12-27 Thread David Winsemius
On Dec 27, 2011, at 9:52 AM, Elliott wrote: Hello R users: I wonder if there are functions for multiple log-rank tests with adjusted P-values. I found survdiff( ) only give pooled tests but without pairwise ones. Klein and Moeschberger suggest Bonferroni as a starting point. Why not use

[R] rbinom

2011-12-27 Thread Scott Raynaud
I have the following code (which I did not write) that generates data based on a logistic model.  I'm only getting a single record with y=1.  It seems implausible that in 50k cases that have a single y=1.  Does that ring alarm bells for anyone else?   beta-c(-1.585600,-0.246900)

[R] Cumulative distribution of coefficient of variation.

2011-12-27 Thread ali_protocol
Hi every one, newbie here. I have a matrix and I want to compute the cumulative distribution of coefficient of variation, for variables (which are in rows) m= matrix ( rnorm (30), 10,3) how is that done? -- View this message in context:

[R] Rhelp-gmm

2011-12-27 Thread 木棉
Dear friend, Hello! When I’m using R, I come across some problems. Could you please give me a hand? Attached is my problem in details. Thanks a lot! -- Ivy Zhang__ R-help@r-project.org mailing list

[R] Color bins for lattice levelplot

2011-12-27 Thread Alex Reynolds
I am creating a levelplot figure with the following code. This should be repeatable code, which includes a link to the data I am working with. --- pdfFn - foo.pdf df - read.table(http://dl.dropbox.com/u/31495717/stackoverflow.overlaps.list.txt;, sep=\t, header=FALSE)

Re: [R] multiple log-rank test for adjusted P value

2011-12-27 Thread Cheung Zihong
Thank you for your reply. I didn't know what adjust methods can apply to log-rank tests.Or the kind of tests are just not relevant? SAS seems to use sidak method to do pairwise log-rank tests. which one is sidak method in p.adjust methods? p.adjust.methods # c(holm, hochberg, hommel,

[R] Summing Data in R

2011-12-27 Thread steven.hazen
Currently I have a data set looking like: License Species Year HD QuotaL.R.QTAL.R.QTASuccess Surplus PermitElk1999101 50 87 90 151 10 PermitDeer1999101 50 20

Re: [R] How to create a matrix with 3 dimensions from several 2 dimensional matrice?

2011-12-27 Thread jim holtman
Is this what you are after: x1 - matrix(1:25, 5) x2 - x3 - x1 # combine matrices, redimension and then rename z - cbind(x1, x2, x3) dim(z) - c(5, 5, 3) z # without names , , 1 [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13

Re: [R] How to create a matrix with 3 dimensions from several 2 dimensional matrice?

2011-12-27 Thread Richard M. Heiberger
Yes, use abind. library(abind) ?abind On Tue, Dec 27, 2011 at 10:34 AM, ali_protocol mohammadianalimohammad...@gmail.com wrote: Hi every one, How is it possible to create a matrix with 3 dimensions from several 2 dimensional matrice? Is it possible that each of elementary/building block

Re: [R] Summing Data in R

2011-12-27 Thread jim holtman
Is this what you are after? Send your sample data using 'dput/dump' next time -- easier to read in: x - read.table(text = License Species Year HD QuotaL.R.QTA L.R.QTASuccess Surplus + PermitElk1999101 50 87 90 151 10 +

Re: [R] Longitudinal data

2011-12-27 Thread Silvano
Hi Uwe, was a great suggestion. Thanks, -- Silvano Cesar da Costa Departamento de Estatística Universidade Estadual de Londrina Fone: 3371-4346 -- - Original Message - From: Uwe Ligges

Re: [R] How to extract an interval of hour:minute type

2011-12-27 Thread ikuzar
Jim Holtman I'd like to compare hour1:min1:sec1 with hour2:min2:sec2. I know how to do to compare year1-mon1-day1 hour1:min1:sec1 with year2-mon2-day2 hour2:min2:sec2 by converting 'character' into POSIXlt but I'd like to konw if there is another way to do this comparison without converting

Re: [R] Summing Data in R

2011-12-27 Thread steven.hazen
Yes that is what I'm trying to do, however when I enter the code

[R] [R-pkgs] RQDA 0.2-2 has been released

2011-12-27 Thread Wincent
Dear all, RQDA is a package for computer-aided qualitative data analysis, currently supporting plain text as qualitative data. It supports various operations in the grounded theory tradition such as coding, retrieval of codings, categorisation, attributes etc. It can also be used for content

[R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread Alex Zhang
Dear all, Happy new year! I have a question re using sapply. Below is a dummy example that would replicate the error I saw.  ##Code Starts here DummyFunc - function(x) { if (x 0) { return (x) } else { return (-x) } } Y = data.frame(val = c(-3:7)) sapply(Y, FUN = DummyFunc) ##Code ends here

Re: [R] multiple log-rank test for adjusted P value

2011-12-27 Thread David Winsemius
On Dec 27, 2011, at 12:05 PM, Cheung Zihong wrote: Thank you for your reply. I didn't know what adjust methods can apply to log-rank tests.Or the kind of tests are just not relevant? SAS seems to use sidak method to do pairwise log-rank tests. which one is sidak method in p.adjust

Re: [R] Summing Data in R

2011-12-27 Thread David Winsemius
On Dec 27, 2011, at 1:01 PM, steven.hazen wrote: Yes that is what I'm trying to do, however when I enter the code aggregate(dstats[,c('QUOTA','L.R.QTA','L.R.A.1ST','L.R.S. 1ST','L.N.QTA','L.N.A.1ST','L.N.S.1ST','R.R.QTA','R.R.A.1ST','R.R.A.

Re: [R] Summing Data in R

2011-12-27 Thread William Dunlap
Your command includes (at about character position 240): 'R.N.S.1ST',R.N.S.2ND' Note the missing quote after the comma. When R's error message starts with Error: instead of Error in command: it usually means it could not parse the text that you typed to make a command out of it. (Perhaps

[R] Using minsplit and unequal weights in rpart

2011-12-27 Thread Saar Golde
Dear r-help mailing list, Is there a way to incorporate weights into the minsplit criteria in rpart, when the weights are uneven? I could not find a way for the minsplit threshold to take the weights into account, and when the weights are uneven it becomes an issue, as the following example

Re: [R] Finding all triangles in a graph

2011-12-27 Thread Albyn Jones
Taral The general problem of finding subgraphs with a given structure (motifs) is hard (ie computationally expensive). There is some literature... have you looked at the package igraph, function graph.motifs()? albyn Quoting Taral tar...@gmail.com: I have the adjacency matrix of a graph.

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread R. Michael Weylandt
You are right that the problem is that DummyFunc isn't vectorized. R looks for a single logical value in an if statement but x0 gives it a whole vector's worth -- as the warning indicates, it only uses the first and pushes the whole vector through the loop in the return(-x) branch, which explains

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread John Fox
Dear Alex, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Alex Zhang Sent: December-27-11 2:14 PM To: r-help@r-project.org Subject: [R] sapply Call Returning the condition has length 1 Error Dear all, Happy new

Re: [R] Summing Data in R

2011-12-27 Thread jim holtman
If the columns are contiguous, then try the following: (you will have to determine the range to use) aggregate(dstats[,c(3:25)],list(dstats$Year,dstats$HD),FUN=sum) On Tue, Dec 27, 2011 at 2:22 PM, William Dunlap wdun...@tibco.com wrote: Your command includes (at about character position 240):

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread Alex Zhang
John, Thanks for the pointers. The DummyFunc is just a made-up example. The true function I need to use is more complicated and would be distractive to include. Do you mean that sapply would take columns in the input data.frame and feed them into FUN as whole vectors? That explains the

Re: [R] How to extract an interval of hour:minute type

2011-12-27 Thread jim holtman
I think one of the suggestion was to use something like, assuming you have the time in POSIXct format(x$time, format = %H:%M:%S) = 20:10:00 format(x$time, format = %H:%M:%S) = 21:00:00 This takes the 'date' out of the equation. You can always write a function to do this for you. On Tue, Dec

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread jim holtman
Tell us what you want to do, not how you want to do it. What is the problem you are trying to solve? You can create your own function/code within the 'apply' to process one element of the vector as a time. What is the output that you expect? There is (almost) always a way of doing it, as long

[R] Calculus package for R

2011-12-27 Thread Jawad Elomari
Hi guys, Is there an R package for calculus operations (e.g. limits, derivatives... etc.)? Regards, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Calculus package for R

2011-12-27 Thread R. Michael Weylandt
stats::D stats::integrate not sure about limits. M On Tue, Dec 27, 2011 at 2:59 PM, Jawad Elomari phd1...@mail.wbs.ac.uk wrote: Hi guys, Is there an R package for calculus operations (e.g. limits, derivatives... etc.)? Regards, __

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread John Fox
Dear Alex, -Original Message- From: Alex Zhang [mailto:alex.zh...@ymail.com] Sent: December-27-11 3:34 PM To: John Fox Cc: r-help@r-project.org Subject: Re: [R] sapply Call Returning the condition has length 1 Error John, Thanks for the pointers. The DummyFunc is just a

Re: [R] Calculus package for R

2011-12-27 Thread David Winsemius
On Dec 27, 2011, at 4:02 PM, R. Michael Weylandt wrote: stats::D stats::integrate And package Ryacas not sure about limits. M On Tue, Dec 27, 2011 at 2:59 PM, Jawad Elomari phd1...@mail.wbs.ac.uk wrote: Hi guys, Is there an R package for calculus operations (e.g. limits,

[R] R Commander options

2011-12-27 Thread Michael Schmidt
I realize this is basic, but I can't figure out the syntax for setting options for R Commander. I'm running Linux Mint and want to increase the R Commander font sizes. I see that there are (apparently command line) options to do so. I have a desktop launcher with the following command line: sh

[R] How to create a loop and then extract values from the list generated by cor.test

2011-12-27 Thread Keith Larson
Dear all, I would like to conduct a Pearson's correlation using cor.test separately for each individual in my data set. Each individual has nine observations of the measurement variable 'Delta13C'. I can figure our how to do it manually one 'Individual_ID' at a time, but I cannot figure out how

Re: [R] How to create a loop and then extract values from the list generated by cor.test

2011-12-27 Thread Jean V Adams
Keith Larson wrote on 12/27/2011 03:05:48 PM: Dear all, I would like to conduct a Pearson's correlation using cor.test separately for each individual in my data set. Each individual has nine observations of the measurement variable 'Delta13C'. I can figure our how to do it manually one

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread Alex Zhang
John, Thank you for your comment.  There is no secret. But the actual function I need to call is rather irrelevant. However don't take it as the abs function. If you like to know, it is a function that converts 4 kinds of old ids from several old database tables into a new id in a new

Re: [R] R Commander options

2011-12-27 Thread Richard M. Heiberger
It is very easy. Here is my Projector() function from library(RcmdrPlugin.HH) Projector - function() { Rcmdr - options()$Rcmdr Projector.options - list(log.font.size = 15, log.width = 54, log.height = 6, output.height = 18, scale.factor = 1.4)

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread Jeff Newmiller
I suggest you (re-?)read the posting guide. Proper etiquette on this list is to provide a fully self-contained (reproducible) example that demonstrates your problem. You are free to supply an alternate to your actual function as long as it illustrates your problem and you can deal with the

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread Alex Zhang
Jeff, Could you please tell me which part of the guide that I didn't follow? I provide a piece of code that can run in R, producing the problem and I also provided my results. Other people wanted to help me to learn more so asked me about more details. I replied very carefully explaining

[R] lmer function bug

2011-12-27 Thread Cheryl Johnson
Hello, When I make certain values greater with the lmer function, variance components that I expect to give a certain value are switched from how I expect them to be. Has anyone else had this problem? Thanks [[alternative HTML version deleted]]

[R] importing NPDB

2011-12-27 Thread alison korte
Does anyone have information about using the National Practitioner Data Bank (NPDB) in R? It's public use data available from the U.S. Department of Health and Human Services that can be downloaded as a .dat or .por file. I can't even figure out how to open the file in R. [[alternative

[R] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Dear R-help members, *(My apologies for cross-posting to both R-help and R-devel -- this question straddles both domains...)* The question: Is it possible to initialize and later free a large data structure strictly within a shared C library, to be used by a function in the C library that I'll

[R] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Dear R-help members, *(My apologies for cross-posting to both R-help and R-devel -- this question straddles both domains...)* The question: Is it possible to initialize and later free a large data structure strictly within a shared C library, to be used by a function in the C library that I'll

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread R. Michael Weylandt
Your puzzle comes from a collision of two somewhat subtle facts that i) sapply() is a wrapper for lapply(), not apply() and ii) data.frame()s are secretly columnwise lists. Because of this, sapply = lapply takes each list element = data.frame column and passes it to the column individually.

Re: [R] importing NPDB

2011-12-27 Thread Marc Schwartz
On Dec 27, 2011, at 4:55 PM, alison korte wrote: Does anyone have information about using the National Practitioner Data Bank (NPDB) in R? It's public use data available from the U.S. Department of Health and Human Services that can be downloaded as a .dat or .por file. I can't even

Re: [R] [Rd] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Thanks Duncan, you've unclogged my thinking. For anybody interested, see below a sketch of the solution. Cheers, James --START SKETCH OF SOLUTION-- #include R.h #include Rinternals.h static typedef struct { int nrow, ncol; double *data; } _myparticle_data_struct; static

[R] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Dear R-help members, *(My apologies for cross-posting to both R-help and R-devel -- this question straddles both domains...)* The question: Is it possible to initialize and later free a large data structure strictly within a shared C library, to be used by a function in the C library that I'll

[R] Lavaan and Average Variance Extracted

2011-12-27 Thread T.M. Rajkumar
I am trying to do a confirmatory factor analysis with Lavaan. I need a way to get at the Variance Extracted information. Is there a simple way to do the calculation. Lavaan does not seem to output this. Thank you Rajkumar -- View this message in context:

Re: [R] sapply Call Returning the condition has length 1 Error

2011-12-27 Thread Alex Zhang
Michael, John and Bert, Thank you all very much for your help. I think I have gained a lot of understanding and am ready to write better code. I will study The R Inferno. I appreciate it. - Alex From: R. Michael Weylandt michael.weyla...@gmail.com To: Alex

Re: [R] R Commander options

2011-12-27 Thread John Fox
Dear Rich and Michael, Thanks, Rich, for answering Michael's question. I'll just add that ?Commander (or Help - Commander help, from the Rcmdr menus) provides information about the available Rcmdr options. Best, John John Fox Senator William McMaster

[R] Pascal's Triangle

2011-12-27 Thread Matilda E. Gogos
Hello, Looking to generate Pascal's triangle in R. How do I get started? Thanks, -- Matilda Gogos matildaelizabe...@gmail.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Probability Question

2011-12-27 Thread Matilda E. Gogos
Hello, This is a question from a class I'm not in (it's also winter break). But, all the same, I don't know where to start in R with this. It's supposed to be done in R. So, can anyone direct me with a helpful hint or 2, on how to get started with the question listed below, or tell me how I can