Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Gabor Grothendieck
We need to define what it means for these models to be the same or different. With the usual lm assumptions suppose for i=1, 2 (the two models) that: y1 = a1 + X b1 + error1 y2 = a2 + X b2 + error2 which implies the following which also satisfies the usual lm assumptions: y1-y2 = (a1-a2) + X(b1

[R] importing multidimensional matrix from MATLAB

2010-06-10 Thread Gopikrishna Deshpande
Hi, Suppose I have a matrix of size 256x14x32 in MATLAB. I want to import that into R. I used readMat and then do.call. But the variable is stored as an array as its done in R. However, I want to define a variable W=array(0,c(256,14,32)) in R and read the multidimensional matlab variable into W. I

[R] R: Collaborative Filtering

2010-06-10 Thread noclue_
Is Collaborative Filtering available in R? It seems I could not find any R package implementing Collaborative Filtering? Thanks! -- View this message in context: http://r.789695.n4.nabble.com/R-Collaborative-Filtering-tp2249934p2249934.html Sent from the R help mailing list archive at Nabble.

[R] To give column names of a data-frame

2010-06-10 Thread suman dhara
Sir, I want to export the results of R in a data frame. So I want to give rownames,columnnames & title to the data-frame.I have applied the following: data.frame(matrix(c(...),nrow=,ncol=),row.names=c("a","b"),col.names=c("c","d"),title="aaa") But, it does not work. Can you help me? Regards, S

Re: [R] Retrieving the 2 row of "dist" computations

2010-06-10 Thread Jeff08
Hey, The code definitely works, but I may need a more elegant way to do it. Rather than 5 rows, the full data contains 829 rows, so instead of d of length 10, d will be of length 343206. Jorge Ivan Velez wrote: > > Hi there, > > I am sure there is a better way to do it, but here is a suggest

[R] error message in fitting tcopula

2010-06-10 Thread Zakaria, Roslinazairimah - zakry001
Hi r-users, I really need help in fitting the t-copula. I try to reproduce the example given by Jun Yan in "Enjoy the joy of copula" but I'm not sure how to correct the error based on the error message. I tried so many ways but still could not get it working. loglik.marg <- function(b, x)

[R] Rmath.dll importing in VB6 problem

2010-06-10 Thread Ali Makhmali
Hi, I am facing a problem which i think i need to explain it to you with some background. I need to use the Project R pnorm function in Visual Basic 6.0. I have already installed R and this is how i perform and get back the result: > pnorm(2, 15) [1] 6.117164e-39 which is what i need. I have a

Re: [R] Help with Tinn-R

2010-06-10 Thread david.jessop
Hi It sounds like you haven't got the right line in your Rprofile.site file. If in Tinn-R you do R, Configure, Permanent this will open and edit this file, adding in the relevant lines including one defining .trPaths. HTH David Jessop -Original Message- From: r-help-boun...@r-proje

Re: [R] geom_ribbon removes missing values

2010-06-10 Thread Karsten Loesing
Hi William, On 6/10/10 2:07 AM, William Dunlap wrote: > I'm not sure exactly what you want in poly_ids, but > if x is a vector of numbers that might contain NA's > and you want a vector of integers that identify each > run of non-NA's and are NA for each then you can get > it with > poly_id <-

[R] Row binding

2010-06-10 Thread makhdoomi
hello i use the following code,but it is talking too much time to execute. It there any alternate code for the same. ## >names(bimas_epitopes) >dim(bimas_epitopes) >z6<-NULL;for ( i in 1:1496837) { if (bimas_epitopes[i,7]>39.99 ) z6<-c(z6,i)} >length(z6) 11

Re: [R] Patch for legend.position={left,top,bottom} in ggplot2

2010-06-10 Thread Karsten Loesing
Hi everyone, here's the same patch as a new branch on GitHub. http://github.com/kloesing/ggplot2/commit/a25e4fbfa4017ed1 Best, --Karsten On 6/7/10 3:39 PM, Karsten Loesing wrote: > Hi Hadley and everyone, > > here's a patch for ggplot2 that fixes the behavior of > opts(legend.position={left

Re: [R] Rmath.dll importing in VB6 problem

2010-06-10 Thread Prof Brian Ripley
On Thu, 10 Jun 2010, Ali Makhmali wrote: Hi, I am facing a problem which i think i need to explain it to you with some background. I need to use the Project R pnorm function in Visual Basic 6.0. I have already installed R and this is how i perform and get back the result: pnorm(2, 15) [1] 6

[R] error in misclass results

2010-06-10 Thread azam jaafari
please help me   again I have a problem.   I want to do cross-validation for multinomial log. reg. I have a response variabe with 7 levels (Z((a,b,c,d,e,f,g)) and 4 predictor(1 classifier and 3 continuous). I did:   #data with 100 observations   > library('bootstrap')   >x<-matrix(c(data$H, data

Re: [R] How to add a new plot in the same graph using add=T at the command plot?

2010-06-10 Thread Petr PIKAL
Hi Peter Ehlers napsal dne 09.06.2010 19:05:24: > Soapbox: > Well, if you're just starting out with R it would be > a VERY good idea to learn right away that T is not TRUE > and F is not FALSE, at least not always. Sooner or > later you WILL have problems. So do yourself a favour > and get into

Re: [R] cbind with vectors of different lengths?

2010-06-10 Thread Roman Luštrik
I wrote a function that cbinds vectors of different lengths. Basically, the function adds NAs to shorter vectors and cbinds in the end. I'm attaching the code for guidance. # This function takes in a list() of vectors and cbinds them into a data.frame. timerMelt <- function(x, write.down = FALSE,

Re: [R] importing multidimensional matrix from MATLAB

2010-06-10 Thread Phil Spector
Gopi - Not much to go by, but maybe this will be helpful: In matlab: themat = rand(10,5,3) save themat In R: library(R.matlab) themat = readMat('themat.mat') dim(themat$themat) [1] 10 5 3 (Since .mat file can store more than one object, readMat returns a list with each object as a

Re: [R] How to add a new plot in the same graph using add=T at the command plot?

2010-06-10 Thread Uwe Ligges
On 10.06.2010 10:19, Petr PIKAL wrote: Hi Peter Ehlers napsal dne 09.06.2010 19:05:24: Soapbox: Well, if you're just starting out with R it would be a VERY good idea to learn right away that T is not TRUE and F is not FALSE, at least not always. Sooner or later you WILL have problems. So do

[R] Odp: question about "mean"

2010-06-10 Thread Petr PIKAL
Hi split/sapply can be used besides other options sapply(split(iris[,1:4], iris$Species), mean) Regards Petr r-help-boun...@r-project.org napsal dne 10.06.2010 00:43:29: > Hi there: > I have a question about generating mean value of a data.frame. Take > iris data for example, if I have a

Re: [R] Re :help to aggregate data

2010-06-10 Thread Uwe Ligges
On 10.06.2010 04:48, Mohan L wrote: Dear All, I have the data some thing like this, I am showing here three days data only: dummy.data<- read.table(file='dummy.txt',sep='', header=TRUE) dummy.data StDate Domaindesc Logins 1 05/01/10xxx 10 2 05/01/10xxx 45 3 05

[R] Odp: cbind with vectors of different lengths?

2010-06-10 Thread Petr PIKAL
Hi you shall use na.action = "na.exclude" option in your lm call? Regards Petr r-help-boun...@r-project.org napsal dne 10.06.2010 01:12:55: > > Hello R help > I have a dataframe, with 71 samples (rows) and 30 variables. I got linear > models for some of the variables, and I want to join fi

[R] Position of Axis Labels (Base Graphics)

2010-06-10 Thread Singmann
Hi, I wonder if there is a way to selectively manipulate the position of the axis labels (i.e., the numbers). As far as I get it from ?par the only way to manipulate it is via mgp = c(x,y,z), where z is the relevant number. However, this manipulates the position of the axis labels for both the x-

Re: [R] makign help files by hand

2010-06-10 Thread Uwe Ligges
On 09.06.2010 19:39, Philip A. Viton wrote: Can someone tell me how to make up (eg) a library's html help files by hand? I think I ought to be able to use RCMD Rdconv for this but (R-2.10.0, MS-win) when I type (in a dos session) "rdcmd rdconv --help" I get a message to the effect that a perl

Re: [R] Position of Axis Labels (Base Graphics)

2010-06-10 Thread Uwe Ligges
On 10.06.2010 11:02, Singmann wrote: Hi, I wonder if there is a way to selectively manipulate the position of the axis labels (i.e., the numbers). As far as I get it from ?par the only way to manipulate it is via mgp = c(x,y,z), where z is the relevant number. However, this manipulates the po

Re: [R] How to add a new plot in the same graph using add=T at the command plot?

2010-06-10 Thread Petr PIKAL
Hi Uwe Ligges napsal dne 10.06.2010 10:37:05: > > > On 10.06.2010 10:19, Petr PIKAL wrote: > > Hi > > > > Peter Ehlers napsal dne 09.06.2010 19:05:24: > > > >> Soapbox: > >> Well, if you're just starting out with R it would be > >> a VERY good idea to learn right away that T is not TRUE > >>

Re: [R] Issues with Bar Graph

2010-06-10 Thread Jannis
> I am having a few problems with this.  1)  My y > label seems to be getting > cut off by the edge of my graphing area.  I have tried > adjusting the "mar" > and "omi" but it doesn't seem to make any difference.  Sure mar changes the plot. Add for example par(mar=c(4,8,4,4)) and you can see th

Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Joris Meys
This is only valid in case your X matrix is exactly the same, thus when you have an experiment with multiple response variables (i.e. paired response data). When the data for both models come from a different experiment, it ends here. You also assume that y1 and y2 are measured in the same scale,

Re: [R] Row binding

2010-06-10 Thread Patrick Burns
See 'The R Inferno' Circle 2 for why this takes so long, and what to do about it. On 10/06/2010 08:35, makhdoomi wrote: hello i use the following code,but it is talking too much time to execute. It there any alternate code for the same. ## names(bimas_e

Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Or Duek
I'll try to add some more information regarding my experiment - maybe that would help clear things out. Instead of actually measuring the learning curve (i.e. number of correct responses per block) I created a variable that substract the number of correct answers from the last block with that of th

Re: [R] Re :help to aggregate data

2010-06-10 Thread eugen pircalabelu
Hello, Or ?aggregate stdate<-c(rep(1,5),rep(2,5)) domaindesc<-c(1,1,1,2,2,2,3,3,3,3) logins<-sample(1:10, 10) dummy.data<-as.data.frame(cbind(stdate,domaindesc,logins)) aggregate(dummy.data[,3], by=list(dummy.data[,1],dummy.data[,2]), FUN=sum) # same result as tapply, but with only levels that

[R] Package not on CRAN mirrow - what now?

2010-06-10 Thread markwebb
Package arulesSequences isn't on CRAN for automatic package install. I downloaded a *.tar.qz version because no *.zip for Windows offered. Why is this? I expanded *.tar.qz in ~R/R-2.11.0/library/arulesSequences I then assumed that R would list it in the packages list but it doesn't. What am I doing

Re: [R] How to add a new plot in the same graph using add=T at the command plot?

2010-06-10 Thread Uwe Ligges
On 10.06.2010 11:15, Petr PIKAL wrote: Hi Uwe Ligges napsal dne 10.06.2010 10:37:05: On 10.06.2010 10:19, Petr PIKAL wrote: Hi Peter Ehlers napsal dne 09.06.2010 19:05:24: Soapbox: Well, if you're just starting out with R it would be a VERY good idea to learn right away that T is no

[R] Capturing buffered output from Rterm

2010-06-10 Thread Keith Jewell
In MS Windows I a) invoke Rterm from a batch file (test.bat) b) to execute commands from a script (m:\test.rsc) c) capturing output in a log file (m:\test.log) BUT if the script results in an error the error message is NOT written to the log file, leaving me problems when the error is from a

[R] Cforest and Random Forest memory use

2010-06-10 Thread Matthew OKane
Hi all, I'm having great trouble working with the Cforest (from the party package) and Random forest functions. Large data set seem to create very large model objects which means I cannot work with the number of observations I need to, despite running on a large 8GB 64-bit box. I would like the

Re: [R] Package not on CRAN mirrow - what now?

2010-06-10 Thread Uwe Ligges
On 10.06.2010 12:28, markw...@afrihost.co.za wrote: Package arulesSequences isn't on CRAN for automatic package install. I downloaded a *.tar.qz version because no *.zip for Windows offered. Why is this? Because the DESCRIPTION file and hence the web page of the package at http://cran.r-proje

Re: [R] Package not on CRAN mirrow - what now?

2010-06-10 Thread Duncan Murdoch
markw...@afrihost.co.za wrote: Package arulesSequences isn't on CRAN for automatic package install. I downloaded a *.tar.qz version because no *.zip for Windows offered. Why is this? I expanded *.tar.qz in ~R/R-2.11.0/library/arulesSequences I then assumed that R would list it in the packages lis

Re: [R] Capturing buffered output from Rterm

2010-06-10 Thread Duncan Murdoch
Keith Jewell wrote: In MS Windows I a) invoke Rterm from a batch file (test.bat) b) to execute commands from a script (m:\test.rsc) c) capturing output in a log file (m:\test.log) BUT if the script results in an error the error message is NOT written to the log file, leaving me problems wh

Re: [R] creating a new variable, conditional on the value of an existing variable, selected conditionally

2010-06-10 Thread Dennis Murphy
Hi: I had Harold's idea (matrix indexing), but I was curious to see which of these ran fastest. I simulated 1000 rows and three columns of binary data, along with a fourth column that sampled the values 1:3 1000 times. Here are the timings: > f <- as.data.frame(matrix(rbinom(3000, 1, 0.4), nrow =

Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Joris Meys
As I explained, you cannot just test two models with different dependent variables. You can model the difference you calculated, if you think you can give a sensible interpretation to it. But be aware of the fact that your model will tell you something about the relation between your predictors and

Re: [R] back transforming arcsine transformations in metafor

2010-06-10 Thread Viechtbauer Wolfgang (STAT)
Dear Chris, Just define the following function: transf.iasin <- function(x) { z <- sin(x)^2 return(z) } to give the inverse of the arcsine transformation. Then specify this function under the atransf argument. I will add the transf.iasin() function to the package. Best, -- Wolfgang Vie

Re: [R] To give column names of a data-frame

2010-06-10 Thread Joris Meys
First of all, read the help file ?data.frame. What you do is adding a variable row.names, column.names and title to your dataframe. What you want to do is set the rownames and colnames. > results <- data.frame(matrix(c(1,2,3,4),nrow=2,ncol=2)) > rownames(results) <- c("a","b") > colnames(results

Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Or Duek
Thank you very much for your answers. The setup is not as you described - all participants have 4 stimuli - 2 for punishment and 2 for reward. all participants see them in mixed blocks. I try to measure the correlation between some personality traits (measured with personality questionnaires) and t

Re: [R] mgcv

2010-06-10 Thread Gavin Simpson
On Mon, 2010-06-07 at 10:25 -0700, Dipa Hari wrote: > > Hello Sir, > I am using mgcv package for my data. > My model isy~x1+f(x2),I want to find out the function f(x2). > Following is the code. > > sm1=gam(y~x1+s(x2),family=binomial, f) > summary(sm1) > plot(sm1,residuals=TRUE, xlab="AGE",pch

Re: [R] Taylor Diagram

2010-06-10 Thread Jim Lemon
On 06/09/2010 10:14 PM, Mustafa Tufan Turp wrote: Dear R users, I need to learn plotting Taylor diagram. I dowloaded the "plotrix" that includes "taylor.diagram" but I dont know how to study with real datasets. Anyone help me? Hi Tufan, Try this: www-pcmdi.llnl.gov/about/staff/Taylor/CV/Tayl

Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Gabor Grothendieck
On Thu, Jun 10, 2010 at 5:33 AM, Joris Meys wrote: > This is only valid in case your X matrix is exactly the same, thus The poster did not give a full explanation so the best that can be done without getting into an extended question and answer is to make some assumptions, show the result and hop

Re: [R] 45 degree tick marks

2010-06-10 Thread Jim Lemon
On 06/10/2010 01:44 PM, beloitstudent wrote: Hello experts. Sorry this is such a novice question, but I have been trying, fruitlessly to get my x axis to angle at 45 degrees. I have tried the text() call with srt and adj and just cannot get my labels to tilt. Does anyone have any other sugges

[R] Power calculation

2010-06-10 Thread Samuel Okoye
Hello, Is there any R function which does power calculation for unbalanced groups (n1 neq n2)? Since power.t.test has n Number of observations (per group). Many thanks, Samuel [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] comparing two regression models with different dependent variable

2010-06-10 Thread Joris Meys
On Thu, Jun 10, 2010 at 2:04 PM, Gabor Grothendieck wrote: > On Thu, Jun 10, 2010 at 5:33 AM, Joris Meys wrote: >> This is only valid in case your X matrix is exactly the same, thus > > The poster did not give a full explanation so the best that can be > done without getting into an extended ques

Re: [R] Power calculation

2010-06-10 Thread Chuck Cleland
On 6/10/2010 8:26 AM, Samuel Okoye wrote: > Hello, > > Is there any R function which does power calculation for unbalanced groups > (n1 neq n2)? Since power.t.test has n > > Number of observations (per group). > > Many thanks, > Samuel See pwr.t2n.test() in the pwr package. http://finzi.psy

Re: [R] Capturing buffered output from Rterm

2010-06-10 Thread Prof Brian Ripley
On Thu, 10 Jun 2010, Keith Jewell wrote: In MS Windows I a) invoke Rterm from a batch file (test.bat) b) to execute commands from a script (m:\test.rsc) c) capturing output in a log file (m:\test.log) BUT if the script results in an error the error message is NOT written to the log file, lea

Re: [R] ANOVA of a sort

2010-06-10 Thread Joris Meys
This is a typical problem we give as a homework to students. If you can't solve this yourself, you really need to brush up your statistical knowledge or look for a statistician close by to cooperate with. Take a look at these : http://www.ats.ucla.edu/stat/r/seminars/repeated_measures/repeated_me

Re: [R] Can RMySQL be used for a paramterized query?

2010-06-10 Thread Henrique Dallazuanna
I think you can do this: ids <- dbGetQuery(conn, "SELECT id FROM my_table") other_table <- dbGetQuery(conn, sprintf("SELECT * FROM my_other_table WHERE t1_id in (%s)", paste(ids, collapse = ","))) On Wed, Jun 9, 2010 at 11:24 PM, Ted Byers wrote: > I have not found anything about this except th

Re: [R] 45 degree tick marks

2010-06-10 Thread Marc Schwartz
On Jun 10, 2010, at 7:18 AM, Jim Lemon wrote: > On 06/10/2010 01:44 PM, beloitstudent wrote: >> >> Hello experts. >> >> Sorry this is such a novice question, but I have been trying, fruitlessly to >> get my x axis to angle at 45 degrees. I have tried the text() call with srt >> and adj and just

Re: [R] Patch for legend.position={left,top,bottom} in ggplot2

2010-06-10 Thread Hadley Wickham
Cool! Thanks Karsten. If you send me a github pull request I'll incorporate it. Hadley On Thursday, June 10, 2010, Karsten Loesing wrote: > Hi everyone, > > here's the same patch as a new branch on GitHub. > >  http://github.com/kloesing/ggplot2/commit/a25e4fbfa4017ed1 > > Best, > --Karsten > >

Re: [R] counting Na/not NA by groups by column

2010-06-10 Thread Henrique Dallazuanna
Try this also: rowsum(`mode<-`(!is.na(m[,-(1:2)]), 'numeric'), m[,2]) On Wed, Jun 9, 2010 at 10:03 PM, steven mosher wrote: > # create a matrix with some random NAs in it > > m<-matrix(NA,nrow=15,ncol=14) > > m[,3:14]<-52 > > m[13,9]<-NA > > m[4:7,8]<-NA > > m[1:2,5]<-NA > > m[,2]<-rep(1800:1804

[R] Sweave cutting new lines

2010-06-10 Thread Florian Burkart
Hi, I have trouble with Sweave (I think) cutting of my newlines. As stated in the help of Sweave, I generate tex code straight from R for dynamically computed reports. If I do this in R: for (i in 0:4) {cat("\n",i,"\n")};cat("\n 3") 0 1 2 3 4 3 The output looks correct. However

[R] glm poisson function

2010-06-10 Thread Phender79
Hi, I'm totally new to R so I apologise for the basic request. I am looking at the incidence of a disease over two time periods 1990-1995 and 2003-2008. I have counts for each year, subdivided into three disease categories and by males/females. I understand that I need to analyse the data using p

Re: [R] Intra-Class correlation psych package missing data

2010-06-10 Thread RCulloch
Hi Bill, No worries, always a million things to do! Thanks very much for the reply, that has cleared that up and I'll look out for the update next week. Many thanks, Ross -- View this message in context: http://r.789695.n4.nabble.com/Intra-Class-correlation-psych-package-missing-data-tp17739

[R] drawing curve

2010-06-10 Thread suman dhara
Sir, I have a problem regarding drawing curve.I pose the problem as follows: suppose I have two vectors: x<-c(1:6) y<-c(.01,.09,.08,.03,.001,.02) plot(x,y) It gives me the plotted points.But I want to draw a smooth curve passing througt these points. How can I do this? Thanks & Regards, Suman D

Re: [R] partial matches across rows not columns

2010-06-10 Thread RCulloch
Hi Jim and Hi Jannis, Thanks very much to both of you for your help! Both methods work perfectly! Always good to know that there is more than one way to skin a cat when it comes to R! I will just need to get a grip on the regular expressions, it would seem. Many thanks again for you r help, muc

Re: [R] drawing curve

2010-06-10 Thread ONKELINX, Thierry
Have a look at the ggplot2 package x <- 1:6 y <- c(.01,.09,.08,.03,.001,.02) dataset <- data.frame(x, y) library(ggplot2) ggplot(data = dataset, aes(x = x , y = y)) + geom_smooth() ggplot(data = dataset, aes(x = x , y = y)) + geom_smooth() + geom_point() ggplot(data = dataset, aes(x = x , y = y))

Re: [R] Sweave cutting new lines

2010-06-10 Thread ONKELINX, Thierry
Hi Florian, Have you tried to replace each '\n' with '\r\n'. That did the trick for me. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszorg Gaverstraat 4 9500 Geraa

[R] [R[ dates on zoo objects

2010-06-10 Thread Erin Hodgess
Dear R People: I have a zoo object with its date index as a factor. > xAle1.zoo$index Error in xAle1.zoo$index : $ operator is invalid for atomic vectors > str(xAle1.zoo) Class 'zoo' atomic [1:32] 1253 1316 1038 1157 1710 1489 1159 1142 945 1245 ... ..- attr(*, "index")= Factor w/ 32 levels "0

Re: [R] Capturing errors [not buffered output] from Rterm

2010-06-10 Thread Keith Jewell
Thanks to both Prof. Ripley and Duncan Murdoch for correctly diagnosing my problem as failure to redirect stderr (nothing to do with buffering). Both pointed me to R CMD BATCH which would have done the job, if I hadn't wanted to run interactively - in my real task (not the example below) I had

[R] points marking

2010-06-10 Thread khush ........
Hi, How to mark points on x axis of a graph keeping x axis as constant and changing y from y1 to y2 respectively. I want to highlight the area from y1 to y2. Any suggestions Thank you Jeet [[alternative HTML version deleted]] __ R-help@r-pro

Re: [R] Wrong symbol rendering in plots (Ubuntu)

2010-06-10 Thread Eduardo J. Chica
Hello, please excuse me if this is a repost, I think I got confused about how to reply. Anyway, I posted the message below about a day and a half ago through Nabble but have not been cleared until today. Here it goes again. Please bear with me I will get better with time. Start of message s

[R] adding column of ordered numbers to matrix

2010-06-10 Thread Assa Yeroslaviz
Hello everyone, I have a matrix of over 4 line and about 30 columns. For my analysis I would like to add another column with ascending numbers (column header should be "order", and than 1,2,3,4 the end of the matrix). During my analysis I reorder them ( due to merge commands by a differen

[R] nls model fitting errors

2010-06-10 Thread Graves, Gregory
What am I failing to understand here? The script below works fine if the dataset being used is DNase1 <- DNase[ DNase$Run == 1, ] per the example given in help(nlrob). Obviously, I am trying to understand how to use nls and nlrob to fit curves to data using R. #package=DAAG attac

Re: [R] Patch for legend.position={left,top,bottom} in ggplot2

2010-06-10 Thread Felipe Carrillo
Hi: I downloaded the patch, how do I incorporate it to my current version of ggplot2?   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Hadley Wickham > To: Karsten Loesing > Cc: "r-help

Re: [R] [R[ dates on zoo objects

2010-06-10 Thread Gabor Grothendieck
or > or # 3 > aggregate(z, as.Date(time(z), "%m/%d/%y")) 2009-04-16 2009-04-17 1 2 On Thu, Jun 10, 2010 at 9:58 AM, Gabor Grothendieck wrote: > Its best to use dput when displaying your data in r-help as in dput(z) > or dput(head(z)) if large. > > Try this: > >> library(zoo) >

Re: [R] drawing curve

2010-06-10 Thread Mario Valle
x<-c(1:6) y<-c(.01,.09,.08,.03,.001,.02) plot(x,y, type='l') Please try ?plot before asking to the list. Ciao! mario On 10-Jun-10 12:11, suman dhara wrote: Sir, I have a problem regarding drawing curve.I pose the problem as follows: suppose I have two vectors: x<-c(1:6) y<-c(.0

Re: [R] drawing curve

2010-06-10 Thread baptiste auguie
The OP asked for a smooth curve, foo = splinefun(x,y) curve(foo, min(x), max(x)) # points(x,y) I'm sure a R wizard could make it a one-liner. HTH, baptiste On 10 June 2010 16:48, Mario Valle wrote: > x<-c(1:6) > y<-c(.01,.09,.08,.03,.001,.02) > plot(x,y, type='l') > > Please try ?plot before

Re: [R] glm poisson function

2010-06-10 Thread Robert A LaBudde
> prop.test(c(271,433),c(6164113,5572041)) 2-sample test for equality of proportions with continuity correction data: c(271, 433) out of c(6164113, 5572041) X-squared = 54.999, df = 1, p-value = 1.206e-13 alternative hypothesis: two.sided 95 percent confidence interval: -4.291428e-05 -

[R] Latex: Date Format conversion

2010-06-10 Thread Felipe Carrillo
Hi: Can't find a way to convert from shortDate to LongDate format. I got: 3/10/10 that I want to convert to March 10, 2010. I am using: \documentclass[11pt]{article} \usepackage{longtable,verbatim} \usepackage{ctable} \usepackage{datetime} \title{my title} \begin{document}   % Convert date \dd

[R] selecting and excluding files through a pattern

2010-06-10 Thread mauede
I have the following files list: > list.files() [1] "Prostate-Cancer_cvs_Dir" [2] "Prostate_Cancer-miRNAs&Genes.Pathway.xml" [3] "Prostate_Cancer_Pathways-miRNAs-GeneTargets-Dir" [4] "Prostate_Cancer_Pathways-miRNAs-GeneTargets-Dir.zip" [5] "Prostate

[R] Date conversion

2010-06-10 Thread Felipe Carrillo
Hi: Can't find a way to convert from shortDate to LongDate format. I got: 3/10/10 that I want to convert to March 10, 2010. I am using: \documentclass[11pt]{article} \usepackage{longtable,verbatim} \usepackage{ctable} \usepackage{datetime} \title{my title} \begin{document}   % Convert date \dd

Re: [R] lattice: how to remove ticks from splom()?

2010-06-10 Thread Bert Gunter
Is the quote below from Deepayan a possible Fortune? It put a sardonic smile on my lips. Bert Gunter Genentech Nonclinical Biostatistics ... You should really get into the habit of reading documentation; it can often turn out to be very useful. -Deepayan Sarkar _

Re: [R] selecting and excluding files through a pattern

2010-06-10 Thread Jorge Ivan Velez
Hi Maura, Try list.files(pattern = 'csv') HTH, Jorge On Thu, Jun 10, 2010 at 11:24 AM, <> wrote: > I have the following files list: > > > list.files() > [1] "Prostate-Cancer_cvs_Dir" > [2] "Prostate_Cancer-miRNAs&Genes.Pathway.xml" > [3] "Prostate_Cancer_Pathways-miRNAs-GeneTargets-Dir" >

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Marc Schwartz
On Jun 10, 2010, at 10:21 AM, Felipe Carrillo wrote: > Hi: > Can't find a way to convert from shortDate to LongDate format. I got: > 3/10/10 that I want to convert to March 10, 2010. I am using: > > \documentclass[11pt]{article} > \usepackage{longtable,verbatim} > \usepackage{ctable} > \usepackag

[R] Problems with BRugs

2010-06-10 Thread R Heberto Ghezzo, Dr
Hello, I am trying to run some examples from the book of P.Congdon. If I run the following script # Program 7.2 Bayesian Statistical Modelling - Peter Congdon # library(R2WinBUGS) setwd("c:/temp/R") mo <- function() { rho ~ dbeta(1,1) th ~ dgamma(0.001,0.001) Y[1] ~ dpois(th) for (t in 2:

[R] levelplot and contour lines

2010-06-10 Thread rchandler
Hello list, Is there a way to add contour lines to a levelplot at different breakpoints than are used for the colors? For example: library(lattice) # colors good but too many contours levelplot(volcano, at=94:195, contour=TRUE) # I thought something like this might work levelplot(volcano,

[R] Odp: adding column of ordered numbers to matrix

2010-06-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.06.2010 15:56:06: > Hello everyone, > > I have a matrix of over 4 line and about 30 columns. Matrix or data.frame? > > For my analysis I would like to add another column with ascending numbers > (column header should be "order", and than 1,2,

Re: [R] lattice: how to remove ticks from splom()?

2010-06-10 Thread Peter Ehlers
It gets my vote. -Peter Ehlers On 2010-06-10 9:30, Bert Gunter wrote: Is the quote below from Deepayan a possible Fortune? It put a sardonic smile on my lips. Bert Gunter Genentech Nonclinical Biostatistics ... You should really get into the habit of reading documentation; it can often tu

Re: [R] [R[ dates on zoo objects

2010-06-10 Thread Gabor Grothendieck
Its best to use dput when displaying your data in r-help as in dput(z) or dput(head(z)) if large. Try this: > library(zoo) > # test data > z <- zoo(1:2, factor(c("04/16/09","04/17/09"))) > > # 1 > aggregate(z, function(x) as.Date(x, "%m/%d/%y")) 2009-04-16 2009-04-17 1 2 > > # o

[R] do faster ANOVAS

2010-06-10 Thread melissa
Dear all R users, I want to realize 800 000 ANOVAS and to store Sum of Squares of the effects. Here is an extract of my table data Product attribute subject rep t1 t2 t3 … t101 P1 A1 S1 R1 1 0 0 … 1 I want to realize 1 ANOVA per timepoint and per attribute, there are 101 timepoints and 8 attr

[R] HOW to install RSQLite database

2010-06-10 Thread vijaysheegi
Please let me know where i have to type below thing to RSQLite database get installed.Please let me know the solution.Thanks in advance RSQLite -- Embedding the SQLite engine in R (The RSQLite package includes a recent copy of the SQLite distribution from http://www.sqlite.org.) Installat

[R] Finding distance matrix for categorical data

2010-06-10 Thread kapil mahant
All, How can we find a distance matrix for categorical data ie. given a csv below var1 var2var3var4 element1-1 yesx a k element1-2 no y b l element1-3 maybe y c m how can i

Re: [R] calibration and validation for svycoxph

2010-06-10 Thread Thomas Lumley
You don't say what you mean by validation and calibration of the model (these terms have multiple meanings) but if you mean looking at how good the prediction is, all the raw materials are available through svykm() and the predict() method for svycoxph(). There aren't any predefined function

[R] coxph and completely missing strata/subsetting

2010-06-10 Thread Federico Calboli
Hi everyone, I'm doing some coxph() analyses with a large and complex dataset. The data was collected in different centers, so I am using strata(centers) to stratify the analysis. My main issue is, not all centers collected all the variables, so for a model such as: coxph(Surv(days, cancer)

Re: [R] coxph and completely missing strata/subsetting

2010-06-10 Thread Erik Iverson
I'm doing some coxph() analyses with a large and complex dataset. The data was collected in different centers, so I am using strata(centers) to stratify the analysis. My main issue is, not all centers collected all the variables, so for a model such as: coxph(Surv(days, cancer) ~ varA + sex +

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Felipe Carrillo
 Marc: My report is done every two weeks and is created automatically. I click a command button on an Excel form and it runs a .rnw script in R creating a latex dynamic report. Excel sends 15 days of data to R, eg: 6/1/10 to 6/15/10. Right above my report I usually write the range of the report m

Re: [R] do faster ANOVAS

2010-06-10 Thread Douglas Bates
The lm and aov functions can take a matrix response allowing you to fit all of the responses for a single attribute simultaneously. On Thu, Jun 10, 2010 at 8:47 AM, melissa wrote: > Dear all R users, > I want to realize 800 000 ANOVAS and to store Sum of Squares of the effects. > Here is an ext

Re: [R] Finding distance matrix for categorical data

2010-06-10 Thread Joris Meys
see ?daisy in the library cluster Cheers Joris On Thu, Jun 10, 2010 at 6:12 PM, kapil mahant wrote: > All, > > How can we find a distance matrix for categorical data > > ie.  given a csv below > >                   var1         var2    var3    var4 > element1-1   yes            x         a      

Re: [R] Finding distance matrix for categorical data

2010-06-10 Thread Joris Meys
correction. See ?daisy in the PACKAGE cluster. *slaps head* cheers Joris On Thu, Jun 10, 2010 at 7:02 PM, Joris Meys wrote: > see ?daisy in the library cluster > > Cheers > Joris > > On Thu, Jun 10, 2010 at 6:12 PM, kapil mahant wrote: >> All, >> >> How can we find a distance matrix for categori

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Marc Schwartz
Felipe, I would not do the processing in TeX, but do it in R and then pass the results to the \Sexpr{}'s. If I am correctly understanding the process flow, put the following R code chunk before the point where you need to output the formatted dates: <> START <- format(as.Date(report[1, 1],

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Felipe Carrillo
Marc: Thanks for reinforcing that, I was just trying to go that route. It seems to be  simpler to import the dataset and just grab the first and last date from it and then format it. Thanks again.   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Serv

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Marc Schwartz
On Jun 10, 2010, at 12:19 PM, Marc Schwartz wrote: > Felipe, > > I would not do the processing in TeX, but do it in R and then pass the > results to the \Sexpr{}'s. > > If I am correctly understanding the process flow, put the following R code > chunk before the point where you need to output

Re: [R] adding column of ordered numbers to matrix

2010-06-10 Thread Greg Snow
> newmat <- cbind( oldmat, order=seq(nrow(oldmat)) ) See ?seq and/or ?rev for descending. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r

Re: [R] points marking

2010-06-10 Thread Greg Snow
Your question is not really clear, do either of these examples do what you want? with(anscombe, plot(x1, y2, ylim=range(y2,y3)) ) with(anscombe, points(x1, y3, col='blue', pch=2) ) with(anscombe, segments(x1, y2, x1, y3, col=ifelse( y2>y3, 'green','red') ) ) with(anscombe, plot(x1, y2, ylim=

Re: [R] levelplot and contour lines

2010-06-10 Thread Deepayan Sarkar
On Thu, Jun 10, 2010 at 9:30 PM, wrote: > Hello list, > > Is there a way to add contour lines to a levelplot at different breakpoints > than are used for the colors? For example: > > > library(lattice) > > # colors good but too many contours > levelplot(volcano, at=94:195, contour=TRUE) > > # I t

Re: [R] nls model fitting errors

2010-06-10 Thread Peter Ehlers
On 2010-06-10 8:27, Graves, Gregory wrote: What am I failing to understand here? Several things; see below. The script below works fine if the dataset being used is DNase1<- DNase[ DNase$Run == 1, ] per the example given in help(nlrob). Obviously, I am trying to understand how to use nl

  1   2   >