[R] r2 and p value dispaly in table

2012-04-29 Thread Kristi Glover
Hello R User, I was trying to display r.squared and p value in table from regression, but I could not display these parameters in the table (matrix) for example individual - c(1,1,6,8,8,9,9,9,12,12) day - c(4,17,12,12,17,3,9,22,13,20) condition - c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68,

[R] How to retrieve QC.pdf generated by IMA.methy450R function

2012-04-29 Thread jtoconnell
Hi, I am new to R and have been trying to utilize the IMA package for analyzing Illumina methylation data. The IMA.methy450R function is used to load the Illumina data set and the manual indicates that this should create a QC.pdf file with basic quality control information (Basic Quality Control

Re: [R] generate random numbers for lotteries

2012-04-29 Thread Mike Miller
On Fri, 27 Apr 2012, Vale Fara wrote: I am working with lotteries and I need to generate two sets of uniform random numbers. Requirements: 1) each set has 60 random numbers random integers? 2) random numbers in the first set are taken from an interval (0-10), whereas numbers in the second

Re: [R] problem in matching numbers in two variables

2012-04-29 Thread Rui Barradas
Hello, Why not == ? x == y which(x == y) Hope this helps, Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/problem-in-matching-numbers-in-two-variables-tp4594912p4594976.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Consolidate column contents of equally named columns

2012-04-29 Thread Rui Barradas
Hello, This solution is not very pretty but it works. nms - unlist(d[1, ]) nm - unique(nms) dd - na.exclude(sapply(nm, function(jj){ inx - nms %in% jj do.call(rbind, as.list(d[, inx])) })) dd - dd[ dd[ , nm[1]] != nm[1], ] dd - data.frame(apply(dd, 2,

Re: [R] Min , Max

2012-04-29 Thread Rui Barradas
Hello, Hello again, I am still having the same problem with the main loop.it succeeded to finish reading and writing from the first file in my listfile but failed when it moves to the second file giving this error:Error: subscript out of bounds Don't subscript then. The only place where

Re: [R] Min , Max

2012-04-29 Thread Rui Barradas
Hello, again. Yes ,It worked. So how can I insert it in my code? Please Easily. Just replace your beginning of loop for(n in 1:length(listfile)) by the for(...) above, and comment out the line h=listfile[n] since it's no longer needed. Rui Barradas -- View this message in context:

Re: [R] Min , Max

2012-04-29 Thread Rui Barradas
Hello, Yes ,It worked. So how can I insert it in my code? Please Simply like this: #for (n in 1:length(listfile)) #{ # h=listfile[n] # for(h in listfile) { Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/Min-Max-tp4593065p4595458.html Sent from the R

Re: [R] lanyrd site for useR! 2012

2012-04-29 Thread cory n
I signed up. I'm doing a talk on real time text classification using node.js and R Cory On Saturday, April 28, 2012 2:20:08 PM UTC-5, Barry Rowlingson wrote: There's now a page on lanyrd (the social conference directory) for useR! 2012 in Nashville: http://lanyrd.com/2012/useR/ its

Re: [R] r-package RDCOMClient

2012-04-29 Thread lm
Hi, I am new to R. I was trying to use RDCOMClient package to access com object based applications within R. This has been working fine for a while. I have identical set up on two PCs (R-2.1.10 running on XP both on network so same profile). Recently while installing a new package, I had to

[R] Equivalent of Nothing (in VBA) or [] in Matlab in R

2012-04-29 Thread lm
Hi, I am very new to R so please excuse me if I am asking very obvious questions. I am trying to call a blackbox api function implemented in as a COM object from R. The function definition says that 1. if calling from VBA, the first parameter should be set to Nothing 2. if calling from matlab,

Re: [R] Unable to compile install rggobi (Solved)

2012-04-29 Thread Indrajit Sengupta
I finally managed to get this done. I went to the contributed packages for version 2.14 Windows 32 bit and downloaded the zip file. This got installed smoothly in R 2.15. Don't know why I did not try this before.   Regards, Indrajit   From: Prof Brian Ripley

Re: [R] parallel package

2012-04-29 Thread Indrajit Sengupta
You don't need quotes in the library statement, you can just use library(parallel).   Regards, Indrajit   From: Uwe Ligges lig...@statistik.tu-dortmund.de To: ya xinxi...@163.com Cc: r-help@r-project.org Sent: Saturday, April 28, 2012 11:57 PM Subject: Re: [R]

[R] RCS (Restriced Cubic Splines)

2012-04-29 Thread Noah Silverman
In the book, Regression Modeling Strategies, Frank Harrell uses the function rcs() often. The current version or R and Hmisc library don't appear to have this function. What is an appropriate substitute? Thank You -- Noah Silverman UCLA Department of Statistics 8208 Math Sciences Building

Re: [R] parallel package

2012-04-29 Thread Uwe Ligges
On 29.04.2012 09:28, Indrajit Sengupta wrote: You don't need quotes in the library statement, you can just use library(parallel). Yes, a special (mis-)feature of library(). Since we are trying to teach R here, we should provide clean R code. In an ideal world, we would be able to say

Re: [R] RCS (Restriced Cubic Splines)

2012-04-29 Thread peter dalgaard
On Apr 29, 2012, at 09:34 , Noah Silverman wrote: In the book, Regression Modeling Strategies, Frank Harrell uses the function rcs() often. The current version or R and Hmisc library don't appear to have this function. What is an appropriate substitute? The rms package, I

Re: [R] r2 and p value dispaly in table

2012-04-29 Thread Tal Galili
You came close. Here is how it might be done: individual - rep(c(1,1,6,8,8,9,9,9,12,12),2) day - rep(c(4,17,12,12,17,3,9,22,13,20),2) condition - rep(c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68, 0.78, 0.73, 0.71),2) test - data.frame(individual, day, condition) #ind.id - unique(test$individual)

[R] Specifying special poisson maximum likelihood

2012-04-29 Thread Denis . Aydin
Hi everyone I am stuck on specifying my own maximum likelihood function for a special poisson model. My poisson model is as follow: O ~ Pois(b*N + b*RR*E) With O = observed cases b = constant (known) N = number of unexposed persons (known) E = number exposed persons (known) RR = relative risk

Re: [R] Hyperspec package: need to change spectra names in a stacked plot

2012-04-29 Thread beleites,claudia
Ciao Roberto, welcome to hyperSpec! 1. reproducible example You can use the example data sets coming with hyperSpec to create examples that everyone can easily reproduce. 2. there's a hyperSpec-help mailing list which you may want to join. You can subscribe at

Re: [R] How to custom colorscale in treemap

2012-04-29 Thread nhbnhb
Hi, ur reply is much appreciated and I think that will work. But i don't know how to incorporate that code into map.market function: function (id, area, group, color, scale = NULL, lab = c(TRUE, FALSE), main = Map of the Market, print = TRUE) { if (any(length(id) != length(area),

[R] combinations

2012-04-29 Thread Melinda Harwood
I am trying to make a function permute that takes two arguments: 1) and alphabet consisting of a set of symbols and 2) a length being a single integer N.With a safety check check in permute() that stops execution (use the stop() function) with a warning when the number of permutations would exceed

Re: [R] problem in matching numbers in two variables

2012-04-29 Thread sagarnikam123
No its not perfectly working see below j-c(1,1,2,2,3) k-c(2,1,1,1,1) j%%k [1] 1 0 0 0 0 problem comes when one of my sequence have 1 -- View this message in context: http://r.789695.n4.nabble.com/problem-in-matching-numbers-in-two-variables-tp4594912p4595849.html Sent from the R help

Re: [R] generate random numbers for lotteries

2012-04-29 Thread billy am
Interesting set of question.. I am completely new to R but let me try my luck. Random number in R x - runif(60 , 0 , 10) # 60 numbers from 0 to 10 y- runif(60, 15 , 25) # same as above , from 15 to 25 The second part though. Do you mean , for( i in 1:length(x)) { z = x[i] + y[i] return z }

Re: [R] parallel package

2012-04-29 Thread admin
I just tried it. library - quantmod library [1] quantmod typeof(library) [1] character So how do I , or anyone , assign a string without ? library - quantmod Error: object 'quantmod' not found What about this? library - c(quantmod) Does it do the job? Sorry if it has been asked. I'm

Re: [R] parallel package

2012-04-29 Thread ya
Hi Uwe and Indrajit, Thank you very much for the response. Since we are talking about this package, can I ask more about how to use it to deal with statistical issues please? I have this data with categorical missing values in it. Now I am trying to impute them using a function called mice

Re: [R] parallel package

2012-04-29 Thread R. Michael Weylandt
You seem confused the library Uwe is talking about is a function not a string These work library(quantmod) library(quantmod) or pkg - quantmod library(pkg) # Doesn't work! library(pkg, character.only = TRUE) # Works Michael On Sun, Apr 29, 2012 at 3:59 AM, ad...@use-r.com wrote:

Re: [R] problem in matching numbers in two variables

2012-04-29 Thread John Kane
I think I misread the question. Is this what you want j - c(1,1,2,2,3) k - c(2,1,1,1,1) xx - j == k which(xx == TRUE) John Kane Kingston ON Canada -Original Message- From: sagarnikam...@gmail.com Sent: Sat, 28 Apr 2012 23:48:43 -0700 (PDT) To: r-help@r-project.org Subject: Re:

Re: [R] parallel package

2012-04-29 Thread admin
Ah .. another thing I learnt. Thanks You seem confused the library Uwe is talking about is a function not a string These work library(quantmod) library(quantmod) or pkg - quantmod library(pkg) # Doesn't work! library(pkg, character.only = TRUE) # Works Michael On Sun,

Re: [R] problem in matching numbers in two variables

2012-04-29 Thread Berend Hasselman
On 29-04-2012, at 08:48, sagarnikam123 wrote: No its not perfectly working see below j-c(1,1,2,2,3) k-c(2,1,1,1,1) j%%k [1] 1 0 0 0 0 problem comes when one of my sequence have 1 Did you try the other solutions that were suggested? Berend

Re: [R] combinations

2012-04-29 Thread Berend Hasselman
On 29-04-2012, at 13:09, Melinda Harwood wrote: I am trying to make a function permute that takes two arguments: 1) and alphabet consisting of a set of symbols and 2) a length being a single integer N.With a safety check check in permute() that stops execution (use the stop() function) with

Re: [R] Writing a Permutation Function

2012-04-29 Thread petermec
Thanks for all the suggestions. This is my final code that seems to be working: alphabet = c(a,b,c,d) holder = c() permute = function(alphabet,n){ while((length(unique(holder))/n)(length(alphabet)^n)){ perm = sample(alphabet, replace=T, size=n) holder = rbind(holder, perm,

Re: [R] r2 and p value dispaly in table

2012-04-29 Thread Kristi Glover
Hi Tal, Thank you so much for the help. I am afraid that I could not make you understand of my problem. The code you wrote is for whole data set, but I wanted to do regression based on Individual and put coefficient, r2 and p value. Individual is group variable. Here I again run the script

Re: [R] Consolidate column contents of equally named columns

2012-04-29 Thread David Winsemius
On Apr 28, 2012, at 10:46 AM, Daniel Malter wrote: Hi, I have a data frame whose first row (not the header) contains the true column names. The same column name can occur multiple times in the dataset. Columns with equal names are not adjacent, and for each observation only one of the

Re: [R] RODBC Error Code 202 on Mac OS X 10.6

2012-04-29 Thread julia . jacobson
Unfortunately, I'm not really making any progresses, despite a lot of effort. I've compiled R on Mac OS X for myself using MacPorts and the error is now state 28000, code 201 which is failed password authentification. __ R-help@r-project.org mailing

Re: [R] Specifying special poisson maximum likelihood

2012-04-29 Thread Ben Bolker
Denis.Aydin at unibas.ch writes: Hi everyone I am stuck on specifying my own maximum likelihood function for a special poisson model. My poisson model is as follow: O ~ Pois(b*N + b*RR*E) With O = observed cases b = constant (known) N = number of unexposed persons (known) E =

Re: [R] Equivalent of Nothing (in VBA) or [] in Matlab in R

2012-04-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Perhaps NULL? Or maybe a vector of length 0you can also just leave arguments missing in R thanks to lazy evaluation so there's not a single equivalent to nothing Hth, Michael On Apr 28, 2012, at 6:04 PM, lm shinilku...@hotmail.com wrote: Hi, I am very new to R so please excuse me if I am

Re: [R] Consolidate column contents of equally named columns

2012-04-29 Thread Bert Gunter
I believe the regularity of the problem allows a (to me, anyway) simpler procedure. td - t(apply(d,2, na.omit)) data.frame(split(as.numeric(td[,-1]),td[,1])) -- Bert On Sat, Apr 28, 2012 at 9:33 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, This solution is not very pretty but it

Re: [R] r-package RDCOMClient

2012-04-29 Thread Robert Baer
These sorts of issues are often machine dependent and not R package or R software dependent, especially when it comes to processes like com. I a,m not a RDCOMClient user, but it's been on my list to look at. You don't provide much info on your various component versions (see posting guide) so

Re: [R] Returning the coef from two coordinates

2012-04-29 Thread Petr Savicky
On Fri, Apr 27, 2012 at 02:08:09PM -0700, Hans Thompson wrote: I meant (1,1) as an (x,y) coordinate. I am trying to find the function to return the coefficient of the line running through: B x y a 1 1 and all the points in: A x y a 1 3 b 2 2 c 3 1 Hi.

[R] parallel package

2012-04-29 Thread ya
Hi Uwe and Indrajit, Thank you very much for the response. Since we are talking about this package, can I ask more about how to use it to deal with statistical issues please? I have this data with categorical missing values in it. Now I am trying to impute them using a function

Re: [R] r2 and p value dispaly in table

2012-04-29 Thread Tal Galili
I am not sure why you would want it, but here it is: individual - c(1,1,6,8,8,9,9,9,12,12) day - c(4,17,12,12,17,3,9,22,13,20) condition - c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68, 0.78, 0.73, 0.71) test1 - data.frame(individual, day, condition) test1 library(plyr) result=ddply(test1,

Re: [R] [R-sig-ME] Xy plot help

2012-04-29 Thread Jeff Newmiller
A) Yes, there is something wrong. Code not reproducible. Behavdat not found. B) Last time I used it, Yahoo Mail could send in plain text. Admittedly that has been awhile, but Google sez read [1] and/or [2]. [1] http://help.yahoo.com/tutorials/mail/mail_persmsg1.html [2]

[R] Count number of rows in a matrix with a character pattern

2012-04-29 Thread katarv
Hi, I have a large data set that I input as a matrix, where I have 1:x rows with names AX, then x+1: y rows named AY, etc. The idea is that I have to count how many rows exactly I have with name AX and how many I have with name AY (or find which row numbers have names AX). Is there any way in

Re: [R] generate random numbers for lotteries

2012-04-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 29, 2012, at 2:25 AM, billy am wickedpu...@gmail.com wrote: Interesting set of question.. I am completely new to R but let me try my luck. Random number in R x - runif(60 , 0 , 10) # 60 numbers from 0 to 10 y- runif(60, 15 , 25) # same as above , from 15 to 25 The second

[R] CForest Error Logical Subscript Too Long

2012-04-29 Thread Abigail Clifton
Hi, This is my code (my data is attached): library(languageR) library(rms) library(party) OLDDATA - read.csv(/Users/Abigail/Documents/OldData250412.csv) OLDDATA$YD - factor(OLDDATA$YD, label=c(Yes, No))  OLDDATA$ND - factor(OLDDATA$ND, label=c(Yes, No))  attach(OLDDATA) defaults - cbind(YD, ND)

[R] Error in if (nuhat 2) stop(The degrees of freedom must be greater than or equal to 2) : missing value where TRUE/FALSE needed

2012-04-29 Thread Kyriakos Antoniou
Hi, i am trying to run an ANCOVA and a bootstrapped ANCOVA analysis on a specific data set. I am using the ancova and ancboot functions as in the following code: setwd(C:/Users/User/Desktop/Rdatabilingualstudy2012) bilingualismdata-read.spss(bilingualdataforconferences2012.sav,

Re: [R] [R-sig-ME] Xy plot help

2012-04-29 Thread Hugo . Mildenberger
On Sun, 29 Apr 2012 11:27:06 -0700 (PDT) arun smartpink...@yahoo.com wrote: I tried to get xyplot shrink fit for my mixed model._ But, the mixed model line is not seen in the graph. I would like to know if there is anything wrong with my code. Typo? Try panel.abline(fixef(fm1),... or

[R] Xy plot help

2012-04-29 Thread arun
Dear R group, Tried to turn off the html in yahoo.  So far  not successful.  Apologies! I tried to get xyplot shrink fit for my mixed model.  But, the mixed model line is not seen in the graph. I would like to know if there is anything wrong with my code. Thanks, A.K. (fm1 - lmer(Response3

Re: [R] generate random numbers for lotteries

2012-04-29 Thread Vale Fara
Hi, thank you both for your replies, I really appreciate it! To Mike: yes, random integers. Can I use the function round() as in the example with 5 random numbers below? To Billy: for the second part I got an error, but it may be that I didn't properly set i...? Here is the R output: x -

Re: [R] Count number of rows in a matrix with a character pattern

2012-04-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'd use a combination of rownames(), grepl() and sum(). Get the names with the first, test with the second and count the positives (by coercing TRUE - 1) with the last Michael On Apr 29, 2012, at 3:46 PM, katarv katiasm...@gmail.com wrote: Hi, I have a large data set that I input as a

[R] CRAN (and crantastic) updates this week

2012-04-29 Thread Crantastic
CRAN (and crantastic) updates this week New packages * anoint (1.0) Maintainer: S. A. Kovalchik Author(s): Ravi Varadhan rvarad...@jhmi.edu and Stephanie Kovalchik License: GPL (= 2) http://crantastic.org/packages/anoint Tools for assessing multiple treatment-covariate

Re: [R] Count number of rows in a matrix with a character pattern

2012-04-29 Thread Rui Barradas
Hello, katarv wrote Hi, I have a large data set that I input as a matrix, where I have 1:x rows with names AX, then x+1: y rows named AY, etc. The idea is that I have to count how many rows exactly I have with name AX and how many I have with name AY (or find which row numbers have

Re: [R] generate random numbers for lotteries

2012-04-29 Thread jim holtman
I would assume that you would use 'sample' to draw the numbers: sample(0:10,60,TRUE) [1] 2 3 1 2 9 2 2 0 3 [10] 0 4 2 3 9 7 3 10 9 [19] 8 5 8 7 6 3 10 0 6 [28] 8 10 6 3 3 2 7 0 0 [37] 1 4 8 2 10 2 0 7 9 [46] 9 9 7 9 6 10 1 1 6 [55] 1 8 3 8 2

[R] need help with avg.surv (Direct Adjusted Survival Curve)

2012-04-29 Thread Manish Dalwani
Hello R users,  I am trying to obtain a direct adjusted survival curve. I am sending my whole code (see below). It's basically the larynx cancer data with Stage 1-4. I am using the cox model using coxph option, see the fit3 coxph. When I use the avg.surv option on fit3, I get the following

Re: [R] Count number of rows in a matrix with a character pattern

2012-04-29 Thread Rui Barradas
Right. Michael Weylandt wrote I'd use a combination of rownames(), grepl() and sum(). Get the names with the first, test with the second and count the positives (by coercing TRUE - 1) with the last Michael On Apr 29, 2012, at 3:46 PM, katarv lt;katiasmirn@gt; wrote: Hi, I

Re: [R] generate random numbers for lotteries

2012-04-29 Thread R. Michael Weylandt
On Sun, Apr 29, 2012 at 4:38 PM, Vale Fara vale...@gmail.com wrote: Hi, thank you both for your replies, I really appreciate it! To Mike: yes, random integers. Can I use the function round() as in the example with 5 random numbers below? To Billy: for the second part I got an error, but it

Re: [R] generate random numbers for lotteries

2012-04-29 Thread Mike Miller
On Mon, 30 Apr 2012, Vale Fara wrote: ok, what to do is to generate two sets (x,y) of integer uniform random numbers so that the following condition is satisfied: the sum of the numbers obtained in x,y matched two by two (first number obtained in x with first number obtained in y and so on)

Re: [R] generate random numbers for lotteries

2012-04-29 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mike Miller Sent: Sunday, April 29, 2012 5:21 PM To: Vale Fara Cc: r-help@r-project.org; billy am Subject: Re: [R] generate random numbers for lotteries On Mon, 30 Apr 2012,

Re: [R] Equivalent of Nothing (in VBA) or [] in Matlab in R

2012-04-29 Thread lm
Thanks Michael. I tried with NULL - It throws Type mismatch error and same error while passing c() or defining a- c() and then passing a as parameter Also tried with not passing any parameter, then it says 'Parameter not optional'. I am afarid no joy. Thanks Regards,lmDate: Sun, 29 Apr 2012

Re: [R] Equivalent of Nothing (in VBA) or [] in Matlab in R

2012-04-29 Thread Rui Barradas
Hello, There are other types of empty objects in R (zero length or dimension). Maybe some of these x - list() length(x) x - matrix(list()) dim(x) - c(0, 0) x Matlab's [] is the empty matrix so maybe the second works. Other possibilities could be x - numeric(0) (or integer(0) or character(0)).

Re: [R] generate random numbers for lotteries

2012-04-29 Thread Mike Miller
On Sun, 29 Apr 2012, Daniel Nordlund wrote: I don't know what the OP is really trying to accomplish yet, and I am not motivated (yet) to try to figure it out. However, all this flooring and ceiling) and rounding is not necessary for generating uniform random integers. For N integers in the

Re: [R] Gls function in rms package

2012-04-29 Thread Mark Seeto
Frank, sorry if I seem impatient, but do you know approximately when this will be fixed? In the meantime, if I have library(nlme) library(rms) d - data.frame(x = rnorm(50), y = rnorm(50)) and I'm interested in the 3 df test for x that I would get from anova(Gls(y ~ rcs(x, 4), data=d,