Re: [R] R 2.12.0 and JGR

2011-02-09 Thread kat
hello mike, it would be helpful to know what you have done, what system you are working on etc. "JGR for Windows and Mac OS X consists of two parts: JGR R package which is available from CRAN and JGR launcher. The latter is a small program that starts JGR from its R package. It can be also used

[R] Permuting rows of a matrix

2011-02-09 Thread Diogo Almeida
Hi, I need to permute the rows of a matrix, where each row is independently rearranged. A simple solution is this: shuffled <- datamatrix <- matrix(1:24, ncol = 4) for (i in 1:nrow(datamatrix)) { shuffled[i, ] <- sample(datamatrix[i, ]) } > datamatrix [,1] [,2] [,3] [,4] [1,]17 1

[R] color2D.maplot fixed color range

2011-02-09 Thread Alaios
Dear all, I have -one matrix sr ([200,200]) which is the original file -25 matrixes estimatedsr ([200,200]) which are an estimation of the sr. As I am plotting these matrixes I want to have ONE common way that the cells are colored. Eg. Values from 10-20--> red color, 20-30-->blue color (or som

Re: [R] Newb Prediction Question using stepAIC and predict(), is R wrong?

2011-02-09 Thread Bill.Venables
Using complex names, like res[, 3+i] or res$var, in the formula for a model is a very bad idea, especially if eventually you want eventualluy to predict to new data. (In fact it won't work, so that makes is very bad indeed.) So do not use '$' or '[..]' terms in model formulae - this is going t

Re: [R] mean and sd for a Dataframe

2011-02-09 Thread David Winsemius
On Feb 10, 2011, at 12:24 AM, Ramya wrote: hi there, I need to subtract each value in the dataframe from the mean of the column and divide by the standard deviation of the column. dim(a) [1] 2201152 data2 <- sapply(seq(from = 2, by = 1, length = 50), function(e){ rbind((a[[e]] - me

[R] mean and sd for a Dataframe

2011-02-09 Thread Ramya
hi there, I need to subtract each value in the dataframe from the mean of the column and divide by the standard deviation of the column. > dim(a) [1] 2201152 data2 <- sapply(seq(from = 2, by = 1, length = 50), function(e){ rbind((a[[e]] - mean(a[,e]))/sd(a[,e])) }) Does this look right

Re: [R] Cohen's Kappa for beginners

2011-02-09 Thread Matthew Schmidt
Refresh list was used, but a restart of the client was necessary for updates to become active. Please advise as to appropriate list. Many thanks! On Wednesday, February 9, 2011, David Winsemius wrote: > > On Feb 9, 2011, at 3:29 PM, matthew.schmidt wrote: > > > > I'm a newb with R and am trying

[R] subscription

2011-02-09 Thread Julie Smith
Hi, How can I unsubscribe from the mailing list? Best, Julie mith [[alternative HTML version deleted]] __ 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

Re: [R] rjdbc identifier.quote

2011-02-09 Thread Armand Pirvu (gmail)
Hi Gabor Thank you for your reply I tried it > dbWriteTable(conn, "table6",mylargedata,identifier.quote ="\"") Error in .sql.qescape(names(value), TRUE, conn@identifier.quote) : The JDBC connection doesn't support quoted identifiers, but table/column name contains characters that must be qu

[R] Newb Prediction Question using stepAIC and predict(), is R wrong?

2011-02-09 Thread BSanders
I'm using stepAIC to fit a model. Then I'm trying to use that model to predict future happenings. My first few variables are labeled as their column. (Is this a problem?) The dataframe that I use to build the model is the same as the data I'm using to predict with. Here is a portion of what is

Re: [R] merge multiple .csv files

2011-02-09 Thread Benjamin Caldwell
Very well, Bill. all = TRUE seemed to fix the problem. On Wed, Feb 9, 2011 at 7:54 PM, wrote: > You want advice? > > 1. Write sentences that contain a subject and where appropriate, an object > as well. This makes your email just that bit more polite. This list is not > a paid service. > > 2.

Re: [R] for loop to merge .csvs

2011-02-09 Thread Steve Lianoglou
Hi, On Wed, Feb 9, 2011 at 11:18 PM, Benjamin Caldwell wrote: > So I needed to merge 17 .csv files, and did so by brute force, but I might > need to do so again. Anyone have suggestions for a for loop that might do > the below for me (where a:r are separate .csv files) > > ab<-merge(a,b,all=TRUE)

Re: [R] for loop to merge .csvs

2011-02-09 Thread David Freedman
you might try merge_recurse(list(DF1,DF2,DF3,DF4,DF17)) in the reshape package -- View this message in context: http://r.789695.n4.nabble.com/for-loop-to-merge-csvs-tp3298549p3298565.html Sent from the R help mailing list archive at Nabble.com. __

[R] for loop to merge .csvs

2011-02-09 Thread Benjamin Caldwell
So I needed to merge 17 .csv files, and did so by brute force, but I might need to do so again. Anyone have suggestions for a for loop that might do the below for me (where a:r are separate .csv files) ab<-merge(a,b,all=TRUE) cd<-merge(c,d,all=TRUE) ef<-merge(e,f,all=TRUE) gh<-merge(g,h,all=TRUE)

Re: [R] rjdbc identifier.quote

2011-02-09 Thread Gabor Grothendieck
On Wed, Feb 9, 2011 at 11:05 PM, Armand Pirvu (gmail) wrote: > Hi Gabor > > Thank you for your  reply > > I tried it > >> dbWriteTable(conn, "table6",mylargedata,identifier.quote ="\"") > Error in .sql.qescape(names(value), TRUE, conn@identifier.quote) : >  The JDBC connection doesn't support quot

Re: [R] merge multiple .csv files

2011-02-09 Thread Bill.Venables
You want advice? 1. Write sentences that contain a subject and where appropriate, an object as well. This makes your email just that bit more polite. This list is not a paid service. 2. The "sheets" may have variables in common, but do they have the same name in both, and the same class, and

Re: [R] rjdbc identifier.quote

2011-02-09 Thread Gabor Grothendieck
On Wed, Feb 9, 2011 at 9:06 PM, Armand Pirvu (gmail) wrote: > Dear all > > > Backend is Ingres DBMS > I use RJDBC with Ingres JDBC driver > > I have this csv file > > "","Strategy","par1","m.1997.09.01" > "1","ALF",2,0.1244 > > > which I try to load it RJDBC > > > require (RJDBC) > drv <- > JDBC(

Re: [R] factor.scores

2011-02-09 Thread Bill.Venables
The function factor.scores does not "inherit" anything. It is a generic function that provieds methods for a number of classes, including those you mention. (The terminology is important if you are to understand what is going on here): > library(ltm) Loading required package: MASS Loading re

Re: [R] merge multiple .csv files

2011-02-09 Thread Erik Iverson
On 02/09/2011 09:21 PM, Benjamin Caldwell wrote: Am trying to merge about 15 .csv tables - tried a test run but came up with 0 rows (no data for each variable/column head) CAHSEE.EA.feb.2009<-read.csv("2009 CAHSEE EA feb 2009.csv", header=TRUE) CAHSEE.IM.MATH.2009<-read.csv("2009 CAHSEE Impact

[R] merge multiple .csv files

2011-02-09 Thread Benjamin Caldwell
Am trying to merge about 15 .csv tables - tried a test run but came up with 0 rows (no data for each variable/column head) > CAHSEE.EA.feb.2009<-read.csv("2009 CAHSEE EA feb 2009.csv", header=TRUE) > CAHSEE.IM.MATH.2009<-read.csv("2009 CAHSEE Impact Math.csv", header=TRUE) > testmerge<-merge(CAHSE

Re: [R] Cohen's Kappa for beginners

2011-02-09 Thread David Winsemius
On Feb 9, 2011, at 3:29 PM, matthew.schmidt wrote: I'm a newb with R and am trying to move from proprietary stats tools to open ones. Hopefully this post might help others doing the same. I downloaded the R package for Mac Posted to the wrong list. and hacked together a couple scripts,

[R] factor.scores

2011-02-09 Thread James Lewis
The function factor.scores is used with package ltm and others to estimate IRT type scores for various models. It inherits objects of class grm, gpcm and a few others. What I would like to do is to use the factor.scores function, but feed it my own item parameters (from a bifactor model where

[R] Need help with merge

2011-02-09 Thread analys...@hotmail.com
Have > actualsdf ID Name datadate val 1 23 Acme Corp1 23 2 23 Acme Corp2 43 3 23 Acme Corp3 54 4 23 Acme Corp4 65 5 23 Acme Corp5 23 6 23 Acme Corp6 43 7 23 Acme Corp7 NA 8 23 Acme Corp8 43 9 23 Acme Corp

[R] rjdbc identifier.quote

2011-02-09 Thread Armand Pirvu (gmail)
Dear all Backend is Ingres DBMS I use RJDBC with Ingres JDBC driver I have this csv file "","Strategy","par1","m.1997.09.01" "1","ALF",2,0.1244 which I try to load it RJDBC require (RJDBC) drv <- JDBC("com.ingres.jdbc.IngresDriver","/home/ingres/ingresv1/ingres/lib/iijdbc.jar") conn <- dbC

Re: [R] expression for index of pairwise combinations

2011-02-09 Thread Pete Brecknock
If I have understood correctly, then as an example for 4 columns how about d=data.frame(C1=c(1,1,1,1,1),C2=c(2,2,2,2,2),C3=c(3,3,3,3,3),C4=c(4,4,4,4,4)) combs=combn(paste("C",seq_len(4),sep=""),2,simplify=FALSE) one = sapply(combs,function(x) d[x[1]]) two = sapply(combs,function(x) d[x[2

Re: [R] Problem with xlsx package

2011-02-09 Thread Gabor Grothendieck
On Wed, Feb 9, 2011 at 6:12 PM, Nikhil Joshi wrote: > I am trying to read an xlsx spreadsheet (1506 rows, 501columns) all > populated but getting the following error: > Please advise as to how to get around this issue. > >> res <- read.xlsx("c:\\BSE_v2.xlsx",1) > Error in .jcall("RJavaTools", "Lja

[R] Revolution Analytics reading SAS datasets

2011-02-09 Thread Daniel Nordlund
Has anyone heard whether Revolution Analytics is going to release this capability to the R community? http://www.businesswire.com/news/home/20110201005852/en/Revolution-Analytics-Unlocks-SAS-Data Dan Daniel Nordlund Bothell, WA USA __ R-help@r-projec

Re: [R] nested ifelse problem

2011-02-09 Thread jim holtman
Read the help page for ifelse again. It return a value; you do not assign values with the the function. You would use it something like this: cbitotal <- ifelse(cond1 , result1 , ifelse(cond2 , result2

Re: [R] nested ifelse problem

2011-02-09 Thread Duncan Murdoch
On 11-02-09 3:47 PM, eck 1 wrote: Hello R-Help users, I have a data frame named fd, a sample of which looks like this: cbi_A cbi_B cbi_B1 cbi_B2 cbi_C cbi_D cbi_E cbi_F 2.183451 1.047546 NA NA NA NA 0.428528 NA 0.795837 0.510152 0.510152 NA NA NA NA NA 0.795837

[R] Problem with xlsx package

2011-02-09 Thread Nikhil Joshi
I am trying to read an xlsx spreadsheet (1506 rows, 501columns) all populated but getting the following error: Please advise as to how to get around this issue. > res <- read.xlsx("c:\\BSE_v2.xlsx",1) Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.lang.OutOfMemor

[R] "Error in plot.window(...) : invalid 'xlim' value" from plot(...par(new = TRUE))

2011-02-09 Thread David Wolfskill
[New to the community; still in early part of R's learning curve.] Several months ago, I was requested to generate some graphs on a periodic basis. Accordingly, I managed to figure out a way to do so, using a combination of Perl and R (in a FreeBSD environment). While I've needed to adjust a few

[R] Multiple inheritance with reference classes?

2011-02-09 Thread Rob Tirrell
ClassS *<-* setRefClass*(*'ClassS', fields = c*(* 'field.s' *)*, methods = list*(* initialize = *function**()* *{* *return**(*initFields*(*field.s = 0*))* *}* *)* *)* ClassM *<-* setRefClass*(*'ClassM', fields = c*(* 'field.m' *)*, methods = list*(* initialize = *function**()*

[R] Transform samples table to rank table

2011-02-09 Thread Psychi
Hi, im searching for a package or function to transform a data frame. Initially the columns represents the ranks and the rows the test persons, which sorts different samples by ranks. Unfortunately sometimes one samples is not differentiable from another one, so they share one rank. So, the orig

Re: [R] Question on sapply

2011-02-09 Thread Khanvilkar, Shashank
Thanks, Nopes.. Does not seem to work. > lapply(z, as.numeric) [[1]] [1] 1 1 [[2]] [1] 2 2 [[3]] [1] 3 3 [[4]] [1] 4 4 > typeof(z[[1]][1]) [1] "character" Shank From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Wednesday, February 09, 2011 12:34 PM To: Khanvilkar, Shashank Cc: r-help@

Re: [R] Cohen's Kappa for beginners

2011-02-09 Thread matthew.schmidt
I'm a newb with R and am trying to move from proprietary stats tools to open ones. Hopefully this post might help others doing the same. I downloaded the R package for Mac and hacked together a couple scripts, but couldn't seem to get the right output. After installing the psych package, I tried

Re: [R] Question on sapply

2011-02-09 Thread Khanvilkar, Shashank
Sorry.. my bad.. I should have done z = lapply(z, as.numeric) That works. Shank From: Khanvilkar, Shashank Sent: Wednesday, February 09, 2011 1:33 PM Cc: r-help@r-project.org Subject: RE: [R] Question on sapply Thanks, Nopes.. Does not seem to work. > lapply(z, as.numeric) [[1]] [1] 1 1 [[2]] [1

[R] nested ifelse problem

2011-02-09 Thread eck 1
Hello R-Help users, I have a data frame named fd, a sample of which looks like this: cbi_A cbi_B cbi_B1 cbi_B2 cbi_C cbi_D cbi_E cbi_F 2.183451 1.047546 NA NA NA NA 0.428528 NA 0.795837 0.510152 0.510152 NA NA NA NA NA 0.795837 1.149577 0.843485 1.122334 NA

Re: [R] Interactions in a nls model

2011-02-09 Thread Anthony Lawrence Nguy-Robertson
Gabor, Looking at your 2nd response, your suggestion is similar to that of Derek Ogle. It was my misinterpretation from your first response that elicited my original rebuttal. I apologize. Thanks, Tony On 2/9/2011 2:47 PM, Gabor Grothendieck wrote: On Wed, Feb 9, 2011 at 1:02 PM, Anthony La

Re: [R] comparing proportions

2011-02-09 Thread array chip
Hi Bert, Thanks for your reply. If I understand correctly, prop.test() is not suitable to my situation. The input to prop.test() is 2 numbers for each group (# of success and # of trials, for example, groups 1 has 5 success out of 10 trials; group 2 has 3 success out of 7 trials; etc. prop.te

Re: [R] add mean and sd to dotplot in each panel using lattice

2011-02-09 Thread Phil Spector
Xiaokuan - Maybe this will get you started: mypanel = function(x,y,...){ agg<-aggregate(y,list(x),function(x)c(mean(x,na.rm=TRUE),sd(x,na.rm=TRUE))) mns = agg[,2][,1] sds = agg[,2][,2] for(i in 1:nrow(agg))llines(c(i-.1,i+.1),rep(mns[i],2),lwd=3) for(i in 1:nrow(agg)){llines(c(i

Re: [R] as.Date

2011-02-09 Thread BXC (Bendix Carstensen)
We spotted that there were problems, and have realized that the as.Date.numeric was a left-over form earlier; it will be removed in the next version of the Epi package. Thanks for the help. br. Bendix > -Original Message- > From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] > Sent:

[R] comparing proportions

2011-02-09 Thread array chip
Hi, I have a dataset that has 2 groups of samples. For each sample, then response measured is the number of success (no.success) obatined with the number of trials (no.trials). So a porportion of success (prpop.success) can be computed as no.success/no.trials. Now the objective is to test if th

Re: [R] Error running LME model

2011-02-09 Thread Ben Bolker
Christina Hemphill hsph.harvard.edu> writes: > > I'm attempting to run an LME model with random intercepts for location and have received an error message. > The model and error message are given below: > > > mixed.distance <- lme (fixed= log(min5inpnc) ~ i93centerline, random=~1|location, dat

Re: [R] Removing Outliers Function

2011-02-09 Thread Carl Witthoft
To answer part 2: You should read up on statistical distributions and when a sample size is (or isn't) large enough to produce reliable statistical parameters such as mean or variance. I suspect David was implying that your yardstick, based on studentized residual, removes valid samples.

Re: [R] Removing Outliers Function

2011-02-09 Thread Greg Snow
For your number 2, look at the outliers data set in the TeachingDemos package and run the 1st set of examples, yes it uses a different rule than you use, but still a common one. Think about what is happening in the example, doesn't that make you a little nervous about methods that automatically

Re: [R] [R-SIG-Mac] Plotting Chinese characters

2011-02-09 Thread Simon Urbanek
Alberto, you simply need a font that has those characters. For example on 10.6 this works: plot.new(); plot.window(0:1,0:1); text(0.5,0.5,"精市",cex=10,family="Hei") You may want to check your system for fonts that you can use (those that have chinese characters when you click on them in Font Bo

Re: [R] VECM - GARCH using maxLik()

2011-02-09 Thread Arne Henningsen
On 9 February 2011 18:33, Philipp Grueber wrote: > thanks for the quick answer & sorry for the mistake. Please find a corrected > version of the code below. Unfortunately, the model still does not work – > due to an error I believed to have overcome: “In log(2 * pi * sig2[i]) : > NaNs produced” Y

Re: [R] assign factor levels based on list

2011-02-09 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Tim Howard > Sent: Wednesday, February 09, 2011 12:44 PM > To: r-help@r-project.org > Subject: [R] assign factor levels based on list > > All, > > Given a data frame and a list

Re: [R] assign factor levels based on list

2011-02-09 Thread David Winsemius
On Feb 9, 2011, at 4:18 PM, David Winsemius wrote: On Feb 9, 2011, at 3:44 PM, Tim Howard wrote: All, Given a data frame and a list containing factor definitions for certain columns, how can I apply those definitions from the list, rather than doing it the standard way, as noted below.

[R] add mean and sd to dotplot in each panel using lattice

2011-02-09 Thread Xiaokuan Wei
Hi, I have a data frame like this: ScoreDoseSex 2.81Dose1M 1.81Dose1M 1.22Dose1M 0.81Dose1M 0.49Dose1M 0.22Dose1M 0.00Dose1M -0.19Dose1M -0.17Dose1F -0.32Dose1F -0.46Dose1F -0.58Dose1F -0.70Dose1F -0.81Dose1F -0.91Dose1F -1.00Dose1F -1.77Dose2M -1.85Dose2M -1.93Dose2M -2.00Dose2M -2.07Dose2M -2.14

Re: [R] assign factor levels based on list

2011-02-09 Thread David Winsemius
On Feb 9, 2011, at 3:44 PM, Tim Howard wrote: All, Given a data frame and a list containing factor definitions for certain columns, how can I apply those definitions from the list, rather than doing it the standard way, as noted below. I'm lost in the world of do.call, assign, paste, and

Re: [R] setIs and setAs

2011-02-09 Thread David Winsemius
On Feb 9, 2011, at 3:50 PM, Erin Hodgess wrote: Dear R People: What is the difference between setIs and setAs, please? Consider the semantic difference btwn coercion and membership. Thanks, Sincerely, Erin -- David Winsemius, MD West Hartford, CT _

[R] setIs and setAs

2011-02-09 Thread Erin Hodgess
Dear R People: What is the difference between setIs and setAs, please? Thanks, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com __ R

Re: [R] Interactions in a nls model

2011-02-09 Thread Gabor Grothendieck
On Wed, Feb 9, 2011 at 1:02 PM, Anthony Lawrence Nguy-Robertson wrote: > Thank you R-forum for you generous help. > > Gabor Grothendieck, I am not sure if anova in the form that you suggested is > the most appropriate (This is probably more of a statistics related, rather > than R related at this

[R] assign factor levels based on list

2011-02-09 Thread Tim Howard
All, Given a data frame and a list containing factor definitions for certain columns, how can I apply those definitions from the list, rather than doing it the standard way, as noted below. I'm lost in the world of do.call, assign, paste, and can't find my way through. For example: #set up d

Re: [R] Question on sapply

2011-02-09 Thread Henrique Dallazuanna
Try this: lapply(z, as.numeric) On Wed, Feb 9, 2011 at 5:16 PM, Khanvilkar, Shashank wrote: > Hello All, > Thanks in advance for all help > I have the following vector of strings that I want to split.. > > > y = c("1/1","2/2", "3/3", "4/4") > > y > [1] "1/1" "2/2" "3/3" "4/4" > > z = strsplit(y,

[R] Question on sapply

2011-02-09 Thread Khanvilkar, Shashank
Hello All, Thanks in advance for all help I have the following vector of strings that I want to split.. > y = c("1/1","2/2", "3/3", "4/4") > y [1] "1/1" "2/2" "3/3" "4/4" > z = strsplit(y,"/") > z [[1]] [1] "1" "1" [[2]] [1] "2" "2" [[3]] [1] "3" "3" [[4]] [1] "4" "4" Now how do I convert all

[R] Error running LME model

2011-02-09 Thread Christina Hemphill
I'm attempting to run an LME model with random intercepts for location and have received an error message. The model and error message are given below: > mixed.distance <- lme (fixed= log(min5inpnc) ~ i93centerline, > random=~1|location, data = nosmokecomp) Error in y[revOrder] - Fitted : non-

Re: [R] How to properly use a generated test string as a name?

2011-02-09 Thread Mark Knecht
On Wed, Feb 9, 2011 at 11:20 AM, Erik Iverson wrote: > > > Mark Knecht wrote: >> >> Title asks it all. >> >> Thanks in advance, >> Mark >> >> a = 1:5 >> b1 = 2:6 >> Z = data.frame(a,b1) >> Z >> >> Z$b1 >> >> count = 1 >> >> MyName = paste("b",count,sep="") >> MyName >> >> Z$MyName > > Z[[MyName]]

Re: [R] How to properly use a generated test string as a name?

2011-02-09 Thread David Winsemius
On Feb 9, 2011, at 2:20 PM, Erik Iverson wrote: Mark Knecht wrote: Title asks it all. Thanks in advance, Mark a = 1:5 b1 = 2:6 Z = data.frame(a,b1) Z Z$b1 count = 1 MyName = paste("b",count,sep="") MyName Z$MyName Z[[MyName]] Also: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-

Re: [R] Removing Outliers Function

2011-02-09 Thread Bert Gunter
If you insist ... 1. You are reinventing wheels (poorly). RSiteSearch("outlier tests",restr="fun") ##RsiteSearch is a handy interface to search facilities on CRAN. # Go to the site directly for more. Or use Google or other search engines. will show you that a R package, outlier, already exists t

Re: [R] Plot colour according to column

2011-02-09 Thread Tsjerk Wassenaar
Hi Anoop, Not sure whether it's too late for you, but is this along the lines of what you want?: x<-0:1000 y<-sin(x/500)+rnorm(1001)/10 z<-cos(x/500)+rnorm(1001)/100 plot(x,y,col=rgb(1,(z-min(z))/(max(z)-min(z)),0)) Or possibly like: plot(x,y,col=rainbow(256)[255*(z-min(z))/(max(z)-min(z))]) M

Re: [R] How to properly use a generated test string as a name?

2011-02-09 Thread Erik Iverson
Mark Knecht wrote: Title asks it all. Thanks in advance, Mark a = 1:5 b1 = 2:6 Z = data.frame(a,b1) Z Z$b1 count = 1 MyName = paste("b",count,sep="") MyName Z$MyName Z[[MyName]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] Loop in variable names

2011-02-09 Thread jim holtman
Try: for(i in angus) { cut <- StoreData[[paste("P", i)]] table(StoreData$CompanyID, !is.na(cut)) } On Wed, Feb 9, 2011 at 1:02 PM, Rita Carreira wrote: > > > Hello! > I would like to do some tables for several variables and I would like to > write a loop that does the table for each variable

Re: [R] Removing Outliers Function

2011-02-09 Thread David Winsemius
On Feb 9, 2011, at 1:25 PM, kirtau wrote: I have two questions, 1) if the solutions is only three or four lines of code is there anyway you can share those lines instead of stating that the solution is easy and providing no code. I prefer not to use an R-Package but have a "raw function".

[R] How to properly use a generated test string as a name?

2011-02-09 Thread Mark Knecht
Title asks it all. Thanks in advance, Mark a = 1:5 b1 = 2:6 Z = data.frame(a,b1) Z Z$b1 count = 1 MyName = paste("b",count,sep="") MyName Z$MyName N = as.name(MyName) Z$N __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

[R] Matching from a dissimilarity / similarity matrix

2011-02-09 Thread Raghu Naik
Folks, I need to create matched test and / control pairs from a (dis)similarity matrix. I am not sure if the existing matching softwares (e.g., optmatch, matchit ) will allow me to input my own dissimilarity matrix. It seems that these algorithms are focusing more on observational studies with t

Re: [R] Loop in variable names

2011-02-09 Thread Eik Vettorazzi
Hi Stella, in your coding 'cut' is a string, not a data object. something like cut <- paste("P",i, sep="") table(StoreData$CompanyID, !is.na(StoreData[,cut])) should work. hth. Am 09.02.2011 19:02, schrieb Rita Carreira: > > > Hello! > I would like to do some tables for several variables an

Re: [R] Expected behavior of as.character ??

2011-02-09 Thread Duncan Murdoch
On 09/02/2011 11:11 AM, koooee wrote: is this the expected behavior of as.character ? resultset is a data.frame from a sqlQuery() using RODBC > a = as.character(as.vector(resultset[1])) > a [1] "c(-1, 1, 2, 3, 4, 5, 6, 7, 8, 9)" I would expect the statement above to return similar to the res

[R] R Courses***February - April 2011 schedule by XLSolutions Corp

2011-02-09 Thread Sue Turner
We've scheduled R courses for February-April 2011 in Washington DC, San Francisco, Seattle, New York City and other USA cities http://www.xlsolutions-corp.com/Rcourses February-April 2011 *** R/S: Programming Essentials *** R Fundamentals and Programming Techniques *** Advanced Statistical Model

Re: [R] Interactions in a nls model

2011-02-09 Thread Anthony Lawrence Nguy-Robertson
Thank you R-forum for you generous help. Gabor Grothendieck, I am not sure if anova in the form that you suggested is the most appropriate (This is probably more of a statistics related, rather than R related at this point). The way I understand anova is that you are testing the variance betwe

Re: [R] heatmap-how to change the order of the rows (genes)

2011-02-09 Thread Mike Marchywka
> Date: Wed, 9 Feb 2011 12:18:57 -0500 > From: yanliu...@gmail.com > To: r-help@r-project.org > Subject: [R] heatmap-how to change the order of the rows (genes) > > Hi, > > I have a question about the heatmap dendrogram in R. I loaded my data > matrix in

Re: [R] Expected behavior of as.character ??

2011-02-09 Thread Erik Iverson
koooee wrote: is this the expected behavior of as.character ? resultset is a data.frame from a sqlQuery() using RODBC a = as.character(as.vector(resultset[1])) a [1] "c(-1, 1, 2, 3, 4, 5, 6, 7, 8, 9)" I would expect the statement above to return similar to the result below, am I missing so

Re: [R] Removing Outliers Function

2011-02-09 Thread kirtau
I have two questions, 1) if the solutions is only three or four lines of code is there anyway you can share those lines instead of stating that the solution is easy and providing no code. I prefer not to use an R-Package but have a "raw function". 2) Can you explain why you feel that this is "

[R] R: [BioC] samr - extract genes from siggenes.table

2011-02-09 Thread Manca Marco (PATH)
I am not sure about this... I think they have logFC larger than 2... you are simply seeing them in scientific notation. Why don't you try setting the option scipen (penalty for scientific notation) "on the high side"? Something like: > options(scipen = 50) should be more than enough... An

Re: [R] Removing Outliers Function

2011-02-09 Thread kirtau
I have two questions, 1) if the solutions is only three or four lines of code is there anyway you can share those lines, without disrespecting me further 2) Can you explain why you feel that this is "statistical malpractice" - - AK -- View this message in context: http://r.789695.n4.nabbl

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-09 Thread Szumiloski, John
The knee jerk thought I had was to express the correlation matrix as a generic Choleski decomposition, then randomly populate the triangular decomposed matrix. When you remultiply, you can simply rescale to 1s on the diagonals. Then rmnorm as usual. In R, see ?chol If you want to get fancy,

[R] Loop in variable names

2011-02-09 Thread Rita Carreira
Hello! I would like to do some tables for several variables and I would like to write a loop that does the table for each variable. I should also point out that my data set has several missing observations and sometimes the observations that are missing are not the same for all my variables.

Re: [R] A question on Duplicating

2011-02-09 Thread rex.dwyer
ab = paste(a,b,sep=";~;~;~") flag = length(ab)==length(unique(ab)) This should work unless you use 3 consecutive winking elephants in other places in your program. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nipesh Bajaj Sen

[R] Expected behavior of as.character ??

2011-02-09 Thread koooee
is this the expected behavior of as.character ? resultset is a data.frame from a sqlQuery() using RODBC > a = as.character(as.vector(resultset[1])) > a [1] "c(-1, 1, 2, 3, 4, 5, 6, 7, 8, 9)" I would expect the statement above to return similar to the result below, am I missing something? > as.

Re: [R] Calling R from .net environment

2011-02-09 Thread agent dunham
I'm going to work with R and .NET in a few weeks, I read that I need R version 11 to be able to call R from .NET, is it true, or is it possible with version 2.12.1? -- View this message in context: http://r.789695.n4.nabble.com/Calling-R-from-net-environment-tp880419p3297585.html Sent from

Re: [R] Plot colour according to column

2011-02-09 Thread anoopmj
Hi Jim, Thanks a lot for the response. I finally decided to do it with ggplot2 library, qplot and layers. It works pretty well, although I did not know how to get the time working... so thanks! Anoop -- View this message in context: http://r.789695.n4.nabble.com/Plot-colour-according-to-column

Re: [R] newbie Question on Generic and Method

2011-02-09 Thread Greg Snow
The generic is what the user calls, the method is what the generic calls. For example, the "summary" function is a generic function, when you issue a command like summary(x) then the generic function looks at what type of object x is and calls the appropriate method which might be the summary.lm

Re: [R] Two Factors and a Numeric Variable in a Plot

2011-02-09 Thread Bert Gunter
Sounds like a job for "trellising" using ?xyplot or "faceting" using ggplot in the gglplot2 package (two terms for the same idea, but different API's for implementation). I suggest you check the R Graph Gallery at: http://addictedtor.free.fr/graphiques/ for ideas. I'm sure you'll find both desig

[R] Two Factors and a Numeric Variable in a Plot

2011-02-09 Thread Rodrigo Aluizio
Hi list. I'm trying to plot a graph "by" factors. Exactly, the x axis are my depths (as.factor), my left y axis are my transects (also as.factor) and I want to plot the mean and standard deviation (three samples per factor combination) of my SW (numeric) variable. The second y axis (at the right)

Re: [R] Problem with long number (from character to numeric class)

2011-02-09 Thread Petr Savicky
On Wed, Feb 09, 2011 at 07:39:55AM -0800, PtitBleu wrote: > > Thanks for all your answers. I didn't know this limit. > > I finally found another way to go around this problem: luckily the 4 first > figures are always the same for all these numbers. > I created a new column with as.numeric(substr(

[R] Adding labels into lattice's barchart

2011-02-09 Thread Luca Meyer
*** APOLOGIZES FOR THOSE READING THE LIST THROUGH NABBLE THIS WAS ALREADY POSTED THERE BUT NOT FORWARDED TO THE LIST FOR SOME UNKNOWN REASON *** I have a dataset that looks like: $ V1: factor with 4 levels $ V2: factor with 4 levels $ V3: factor with 2 levels $ V4: num (summing up to 100 wit

Re: [R] VECM - GARCH using maxLik()

2011-02-09 Thread Philipp Grueber
Hi Arne, thanks for the quick answer & sorry for the mistake. Please find a corrected version of the code below. Unfortunately, the model still does not work – due to an error I believed to have overcome: “In log(2 * pi * sig2[i]) : NaNs produced” So my questions remain the same: Why doesn't thi

Re: [R] precision of gamma function

2011-02-09 Thread Mike Marchywka
> Date: Wed, 9 Feb 2011 18:23:21 +0100 > From: savi...@praha1.ff.cuni.cz > To: r-help@r-project.org > Subject: Re: [R] precision of gamma function > > On Wed, Feb 09, 2011 at 05:23:27PM +0200, Chuse chuse wrote: > > Dear R users, > > > > I have to calcula

Re: [R] wrong length error

2011-02-09 Thread Dennis Murphy
Hi: On Wed, Feb 9, 2011 at 6:29 AM, Claudio Carneiro < claudio_carneiro...@hotmail.com> wrote: > > Hi, all > > I'm trying to solve an optimization problem with two > variables, in wich Iuse the following functions(they all are working > perfectly): > > fxx1=function(x){ > calc=((2.5/3)*((x/3)^(2.

Re: [R] heatmap-how to change the order of the rows (genes)

2011-02-09 Thread Steve Lianoglou
Hi, On Wed, Feb 9, 2011 at 12:18 PM, yan liu wrote: > Hi, > > I have a question about the heatmap dendrogram in R.  I loaded my data > matrix in command heatmap(), and it gave me a heatmap accordingly, and the > rows (genes) also were clustered accordingly.  But now I don't want the > genes clust

Re: [R] precision of gamma function

2011-02-09 Thread Petr Savicky
On Wed, Feb 09, 2011 at 05:23:27PM +0200, Chuse chuse wrote: > Dear R users, > > I have to calculate gamma functions for negative numbers beyond -171.4. > e.x. gamma(-500.4) > I got following: > > > gamma(-170.4) > [1] -5.824625e-308 > > gamma(-171.4) > [1] 0 > Warning message: > underflow occurr

[R] heatmap-how to change the order of the rows (genes)

2011-02-09 Thread yan liu
Hi, I have a question about the heatmap dendrogram in R. I loaded my data matrix in command heatmap(), and it gave me a heatmap accordingly, and the rows (genes) also were clustered accordingly. But now I don't want the genes clustered in that way, I have a new order of these genes, and want the

Re: [R] wrong length error

2011-02-09 Thread jim holtman
Your basic problem seems to be that the function RxMixed does not return a value of the same length as its input parameter. I just used the 'debug' library and here is what I got: > mtrace(RxMixed) > integrate(RxMixed,0,10) D(3)> [1] 0.8826402 D(3)> x [1] 5. 0.13046736 9.86953264 0.674

Re: [R] Need help merging two dataframes

2011-02-09 Thread Dennis Murphy
Hi: Here's one approach to the problem you posed (don't know if it is what you want for the problem you intend you use it on...) df1 <- read.table(textConnection(" id sexage area 01 male adult LP 01 male adult LP 01 male

Re: [R] Problem with long number (from character to numeric class)

2011-02-09 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of PtitBleu > Sent: Wednesday, February 09, 2011 4:15 AM > To: r-help@r-project.org > Subject: [R] Problem with long number (from character to numeric class) > > > Hello, > > I hav

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-09 Thread Eik Vettorazzi
Hi Rick, you can generate an arbitrary matrix X and calculate X'X, which is at least positive semi-definite (and definite, when X has full rank) X<-matrix(rnorm(16),4) covmat<-t(X)%*%X #check !any(eigen(covmat)$value<0) #corresponding correlation matrix cov2cor(covmat) Random multivariate can b

[R] test proportion

2011-02-09 Thread phoebe kong
Hi all, I have a hypothesis test of proportion question without using R. I hope you could help to answer my question. Here is the statement. * Preliminary data from a feasibility study showed a potential failure level of 1%. A sample size was calculated to detect a potential

Re: [R] Parallel processing question ...

2011-02-09 Thread Steve Lianoglou
Hi David, I'm CC-ing R-help inorder to finish this one off ;-) On Wed, Feb 9, 2011 at 10:59 AM, Robinson, David G wrote: [snip] > One of you comments pointed me in the right direction and I found the > problem. I simply commented out the line " if (j%%100==0) { ...print(N)}" > and the original p

[R] samr - extract genes from siggenes.table

2011-02-09 Thread Assa Yeroslaviz
Hi BioC user, I have a problem extracting the gene set I would like to work with. Here is I work with my data: normData <- read.delim("normalizedData.txt",sep ="\t") # two class unpaired comparison # y must take values 1,2 classes <- c(-1,-2,1,2) #prepere the data for the samr analysis

  1   2   >