Re: [R] statistics

2011-04-08 Thread peter dalgaard
On Apr 8, 2011, at 20:33 , vikas wrote: > if X is a binomial variate with parameters n and p, find E[1/(X+1)] > (A) This is not a list for helping people with their homework (B) This is to be solved using pencil and paper. R can't help you there. (C) Once you have a solution, you can check the

[R] Testing.

2011-04-08 Thread Rolf Turner
Please ignore this message. Just testing something Apologies for taking up bandwidth. cheers, Rolf Turner __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] How to define a number of matrices through loops

2011-04-08 Thread Joshua Wiley
Hi Ajss, You instantiated mt as a vector, not a list. Try: row <- c(3,4,6,4,5) mt <- vector("list", length(row)) # list with length of "row" elements for (i in 1:5){ mt[[i]] <- matrix(nrow=row[i], ncol=4) } mt Or in one line: mt <- lapply(1:5, function(x) matrix(nrow = x, ncol = 4)) mt Hope th

Re: [R] multinom() residual deviance

2011-04-08 Thread Bill.Venables
The two models you fit are quite different. The first is a binomial model equivalent to fm <- glm(I(y == "a") ~ x, binomial, df) which you can check leads to the same result. I.e. this model amalgamates classes "b" and "c" into one. The second is a multivariate logistic model that considers

Re: [R] R and lazy evaluation

2011-04-08 Thread Russ Abbott
Here's how to do it in Haskell. First define fibs to be an infinite list. Since Haskell is lazy, the list isn't actually created until needed. The function zipWith takes three arguments: a function and two lists. (It is similar to sapply except that it takes a function and two lists.) It applies

[R] How to define a number of matrices through loops

2011-04-08 Thread Amarjit Singh Sethi
Hi all I need to deal with a number (say, 5) of diferent ordered matrices  simultaneously in my computational work. I tried to define these matrices through looping, but got an error message: row <- c(3,4,6,4,5) mt <- c() for (i in 1:5){  mt[i] <- matrix(nrow=row[i],ncol=4) } mt Kindly help Y

[R] In svm(), how to connect quantitative prediction result to categorical result?

2011-04-08 Thread Li, Yunfei
Hi, I am studying using SVM functions of e1071 package to do prediction, and I found during the training data are "factor" type, then svm.predict() can predict data directly by categories; but if response variables are "numerical", the predicted value from svm will be continuous quantitative nu

[R] 2 dimensional Measure of Smoothness/ Hurst Exponent questions

2011-04-08 Thread xiang li
Dear R users: In my research I need to come up with a method to measure the smoothness for a closed curve (looks like ellipse, but actually not). I was working on calculating Hurst Exponent using 2 dimensional dataset. I checked fArma, Randomfields and several functions in fractal packages, but c

[R] A question about "txtProgressBar" function

2011-04-08 Thread Li, Yunfei
Hi, I tried to add a progress bar to my script, but it seems the "txtProgressBar" function will wipe out what I want to print before it(for example - the "Hello" in following script), and the parameters "title" and "label" do not work either. How can I put a title for the progress bar? or is th

Re: [R] Problem with pairs() in nlme

2011-04-08 Thread dgmaccoon
The age of this post makes me hope there is an easy response from someone. When I do the following with Orthodont built-in dataset: library(nlme) OrthoFem<-Orthodont[Orthodont$Sex=="Female",] fm1OrthF.lis<-lmList( distance ~ age,data = OrthoFem) I get the same error: Error in function (clas

[R] statistics

2011-04-08 Thread vikas
if X is a binomial variate with parameters n and p, find E[1/(X+1)] -- View this message in context: http://r.789695.n4.nabble.com/statistics-tp3437152p3437152.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Rpart decision tree

2011-04-08 Thread tudor
Dear Tal and Achim: Thank you both for your assistance. I followed Achim's suggestions and got what I needed on a Windows machine with R2.12.2 installed. As I needed to run the task on a Windows machine with R2.11.1 I used the package rpart.plot (by Stephen Milborrow) to create my charts. Best

Re: [R] Alignment of lines within barplot bars

2011-04-08 Thread snowboarder101
Thanks for the reply. I looked at this before as I saw you had posted this, but this either doesn't work in my situation, or I am using it wrong. Take the example in the function: tmp <- barplot(1:4) updateusr(tmp[1:2], 0:1, 1:2, 0:1) lines(1:4, c(1,3,2,2), lwd=3, type='b',col='red') But I want

Re: [R] How to create a 3d Surface plot from a CSV file?

2011-04-08 Thread B77S
step # 1 ?read.csv -- View this message in context: http://r.789695.n4.nabble.com/How-to-create-a-3d-Surface-plot-from-a-CSV-file-tp3437463p3437478.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https

Re: [R] best practice(s) for retrieving a local variable from a closure

2011-04-08 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Benjamin Tyner > Sent: Friday, April 08, 2011 6:48 PM > To: r-help@r-project.org > Subject: [R] best practice(s) for retrieving a local variable > from a closure > > Greetings,

Re: [R] Memory allocation problem

2011-04-08 Thread Joshua Wiley
Hi Felipe, On Fri, Apr 8, 2011 at 7:54 PM, Luis Felipe Parra wrote: > Hello, I am runnning  a program on R with a "big" number of simulations and > I am getting the following error: > > Error: no se puede ubicar un vector de tamaño  443.3 Mb > > I don't understand why because when I check the mem

[R] Memory allocation problem

2011-04-08 Thread Luis Felipe Parra
Hello, I am runnning a program on R with a "big" number of simulations and I am getting the following error: Error: no se puede ubicar un vector de tamaño 443.3 Mb I don't understand why because when I check the memory status in my pc I get the following: > memory.size() [1] 676.3 > memory.siz

Re: [R] integration

2011-04-08 Thread Ravi Varadhan
?integrate From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of cindy Guo [cindy.g...@gmail.com] Sent: Friday, April 08, 2011 9:21 PM To: r-help@r-project.org Subject: [R] integration Hi, All, I have a density function with 3 v

Re: [R] a strange behavior with ifelse

2011-04-08 Thread jim holtman
try this: > a=c(2,NA,NA,NA,2,2,NA,2,NA,2) > b=c(NA,1,1,NA,2,2,2,2,2,2) > c1 <- ifelse((!is.na(a) & a == 1) | (!is.na(b) & b == 1) + , 1 + , ifelse((!is.na(a) & a == 2) | (!is.na(b) & b == 2) + , 2 + , NA + ) + ) > cbind(a, b, c1)

Re: [R] best practice(s) for retrieving a local variable from a closure

2011-04-08 Thread Gabor Grothendieck
On Fri, Apr 8, 2011 at 9:48 PM, Benjamin Tyner wrote: > Greetings, > > Say I have defined > >  mp <- function(a) function(x) x^a > >  f2 <- mp(2) > > and I would like to retrieve the "a" which is local to f2. Two options come > to mind; > >  get("a", envir=environment(f2)) >  eval(substitute(a), e

[R] best practice(s) for retrieving a local variable from a closure

2011-04-08 Thread Benjamin Tyner
Greetings, Say I have defined mp <- function(a) function(x) x^a f2 <- mp(2) and I would like to retrieve the "a" which is local to f2. Two options come to mind; get("a", envir=environment(f2)) eval(substitute(a), environment(f2)) I'm curious if one of these is preferred over the other

[R] integration

2011-04-08 Thread cindy Guo
Hi, All, I have a density function with 3 variables which is defined on some irregular domain, and I want to get the marginal distribution of each variable. Is there any function doing this? A simple example is p(x,y,z)=x*y*z*I(xy>z). So each marginal distribution is a function of the other two v

Re: [R] lattice: par.settings: custom axis.line by panel

2011-04-08 Thread Benjamin Tyner
Thanks Deepayan! I neglected to mention that I would want to retain ticks as well for the boxed panel(s), so perhaps something like xyplot(y ~ x|f, data = Data, layout=c(2,1), scales=list(relation="free",alternating=FALSE), par.settings = list(axis.line=list(col = "tran

Re: [R] Finding elements in a character vector

2011-04-08 Thread Downey, Patrick
Perfect. Thank you. -Mitch -Original Message- From: Phil Spector [mailto:spec...@stat.berkeley.edu] Sent: Friday, April 08, 2011 8:03 PM To: Downey, Patrick Cc: r-help@r-project.org Subject: Re: [R] Finding elements in a character vector match(list.a,list.b)

Re: [R] Finding elements in a character vector

2011-04-08 Thread Phil Spector
match(list.a,list.b) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

[R] Finding elements in a character vector

2011-04-08 Thread Downey, Patrick
Hello, I have two character vectors: list.a and list.b. Every element of list.a appears somewhere in list.b. Not all elements of list.b are in list.a, and some elements of list.b appear multiple times in list.a. I want to create a new vector (index) of the same length as list.a where the nth eleme

Re: [R] Runing perl script from R

2011-04-08 Thread Duncan Murdoch
On 11-04-08 4:56 PM, Rice, Terri wrote: Hi. I am trying to run perl script from R. Here's what happens. setwd("C:\\Terri\\perl") getwd() [1] "C:/Terri/perl" list.files() [1] "hello.pl" "lines1_10.txt" "try_my.pl" "try_my.txt" system("hello.pl") Warning message: In system("hello.pl

Re: [R] a bug in "write.csv"?

2011-04-08 Thread Shi, Tao
As pointed out by Ista, please read the help file. "write.csv and write.csv2 provide convenience wrappers for writing CSV files. They set sep, dec and qmethod, and col.names to NA if row.names = TRUE and TRUE otherwise. " From: John Kane To: r-help ; San

Re: [R] Fast version of Fisher's Exact Test

2011-04-08 Thread Steven McKinney
Do you mean a test something such as this? > fisher.test(matrix(c(502,498,490, 510), nrow = 2)) Fisher's Exact Test for Count Data data: matrix(c(502, 498, 490, 510), nrow = 2) p-value = 0.6228 alternative hypothesis: true odds ratio is not equal to 1 95 percent confidence interval:

Re: [R] a bug in "write.csv"?

2011-04-08 Thread John Kane
I believe write.csv had been revamped and some options are no longer available. --- On Fri, 4/8/11, Santosh wrote: > From: Santosh > Subject: [R] a bug in "write.csv"? > To: "r-help" > Received: Friday, April 8, 2011, 4:18 PM > Dear Rxperts! > > A simple example where "write.csv" does not see

[R] Package mice: Error in if (meth[j] != "") { : argument is of length zero

2011-04-08 Thread Rita Carreira
Dear R users, I am using package mice and I am getting the error " Error in if (meth[j] != "") { : argument is of length zero." I have tried using several different versions of R (even the one that will be coming out this month) to no avail. I am using RStudio as my interface with R. Also note t

[R] Runing perl script from R

2011-04-08 Thread Rice, Terri
Hi. I am trying to run perl script from R. Here's what happens. > setwd("C:\\Terri\\perl") > getwd() [1] "C:/Terri/perl" > list.files() [1] "hello.pl" "lines1_10.txt" "try_my.pl" "try_my.txt" > system("hello.pl") Warning message: In system("hello.pl") : Impossible to run C:\Terri\perl\hel

Re: [R] a bug in "write.csv"?

2011-04-08 Thread Ista Zahn
Please read the documentation where this is clearly explained. See ?write.csv Best, Ista On Fri, Apr 8, 2011 at 4:18 PM, Santosh wrote: > Dear Rxperts! > > A simple example where "write.csv" does not seem to accept user specified > arguments.. Why? > > write.csv(t(1:10),"./te1.csv",quo=F,col.nam

[R] a bug in "write.csv"?

2011-04-08 Thread Santosh
Dear Rxperts! A simple example where "write.csv" does not seem to accept user specified arguments.. Why? write.csv(t(1:10),"./te1.csv",quo=F,col.names=F) Warning message: In write.csv(t(1:10), "./te1.csv", quo = F, col.names = F) : attempt to set 'col.names' ignored However, write.table does

[R] gstat data formatting

2011-04-08 Thread EdmAB
Hello, I am interested in using the hscat command in the gstat package to create h-scatterplots of snow depth measurements over a given area (spatial autocorrelation). Unfortunately I do not understand how to format my data for import into R for use with the hscat command. I have checked the gstat

Re: [R] "local({})" documentation?

2011-04-08 Thread Martin Morgan
On 04/08/2011 11:11 AM, Doug Elias wrote: Greetings, all ... I'm trying to find documentation on the use of the "local()" function, and am drawing a complete blank; would someone please send me a pointer to where I can learn what it is intended for, and how to correctly use it? Hi Doug -- ?lo

Re: [R] a strange behavior with ifelse

2011-04-08 Thread Joshua Wiley
Hi, The problem is that (a == 1 | b == 1) returns some NAs. NAs are not treated as strictly TRUE or FALSE. From the documentation (see ?ifelse) "Missing values in 'test' give missing values in the result". You need to use a construct designed to force a TRUE/FALSE value OR something that handle

Re: [R] "local({})" documentation?

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 2:11 PM, Doug Elias wrote: Greetings, all ... I'm trying to find documentation on the use of the "local()" function, and am drawing a complete blank; would someone please send me a pointer to where I can learn what it is intended for, and how to correctly use it? Try ?local. As

Re: [R] Rpart decision tree

2011-04-08 Thread tudor
Hi Tal: Thanks for your quick reply. I tried to create a classification tree. The problem is that the branches overlap the text in the ellipses (inner nodes) and rectangles (terminal nodes) - At times this makes it difficult for the reader to correctly process the results. One way to overcome

[R] "local({})" documentation?

2011-04-08 Thread Doug Elias
Greetings, all ... I'm trying to find documentation on the use of the "local()" function, and am drawing a complete blank; would someone please send me a pointer to where I can learn what it is intended for, and how to correctly use it? Many thanks! Doug [[alternative HTML version delet

[R] a strange behavior with ifelse

2011-04-08 Thread wgu
I have used R for years but run into a seemingly simple problem involving 'ifelse'. condensed code like this a=c(2,NA,NA,NA,2,2,NA,2,NA,2) b=c(NA,1,1,NA,2,2,2,2,2,2) #I want to combined a and b into c so that c would be a valid number either a or b is not missing c=ifelse(a==1|b==1,1,ifelse

Re: [R] lars - lasso problem

2011-04-08 Thread gauri j
HI, Thank you, I will try this, and let you know about the results. Thanks once again. Gauri 2011/4/8 Steve Lianoglou > Hi, > > First: Please make sure you CC R-help when responding to messages on > the list so that more people can help you, and more people can benefit > from help that is prov

Re: [R] Rpart decision tree

2011-04-08 Thread tudor
Hi Achim: I will give it a try and let you know how it goes. Thanks. Tudor -- View this message in context: http://r.789695.n4.nabble.com/Rpart-decision-tree-tp3435888p3437212.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

[R] dynamic argument names and values as variables inside a loop

2011-04-08 Thread Christopher Marcum
Greetings All! After much trial and error, and an exhaustive search of the archives, I'm writing to solicit help with a problem. I want to dynamically modify variable names and values as function arguments inside a loop. I have a canned function from a package that takes ellipsis (...) arguments

Re: [R] set locale information in R

2011-04-08 Thread Uwe Ligges
Try Sys.setenv("LANGUAGE"="Fr") Uwe Ligges On 07.04.2011 10:29, Raji wrote: Hi R-helpers, Is it possible to localise the error messages/warnings that comes from R.My application takes in a locale information.I used the following command to set the locale in R.But in RGui, i still get the e

Re: [R] Windrose Percent Interval Frequencies Are Non Linear! Help!

2011-04-08 Thread Peter Ehlers
On 2011-04-08 09:26, Ben Bolker wrote: Brittain Briber yahoo.com> writes: Do you two or anyone else out there happen to know if it is possible to specify the width of the intervals in windrose? Is there a parameter that I can pass along that would do this? Below is a reproducible scri

Re: [R] Avoiding a loop

2011-04-08 Thread Niels Richard Hansen
I believe the solutions proposed ignore the recursive nature of the original problem and hence produce wrong solutions. P <- c(5, 7, 6.01, 6.01, 7) m <- rep(6, 5) S0 <- as.numeric(P>(m*1.005)) Then the original loop from Worik gives S <- S0 for(i in 2:length(S)){ if(S[i]==0 && S[i-1] == 1){

Re: [R] lars - lasso problem

2011-04-08 Thread Steve Lianoglou
Hi, First: Please make sure you CC R-help when responding to messages on the list so that more people can help you, and more people can benefit from help that is provided. You can do so easily by replying with "reply-all." Now: Look at the help for the lars function: R> ?lars You'll see that `x

Re: [R] Fast version of Fisher's Exact Test

2011-04-08 Thread Bert Gunter
1. I am not an expert on this. 2. However, my strong prior would be no, since because it is "exact" it has to calculate all the possible configurations and there are a lot to calculate with the values of n1 and n2 you gave. -- Bert On Fri, Apr 8, 2011 at 9:43 AM, Jim Silverton wrote: > Is anyon

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread algorimancer
Thank you all for the astoundingly quick responses. I think that the bounding open/closed braces approach sounds like the easiest solution for the moment -- though I look forward to seeing this all automated in a future version of R :) Incidentally, I have indeed encapsulated much of the code as

[R] How to check redundancy of variable and reduce data dimension

2011-04-08 Thread Bill Hyman
Dear all, Do you know how to check redundancy of variables and reduce the dimension in R? It seems PCA can do this. Is there any other better way to implement in R? Many thanks! Bill __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] Fwd: The results of your email commands

2011-04-08 Thread Rohit Pandey
Hi R community, I posted a question on using the R maximum likelihood functions a short while ago and got an email saying that some of the content was "unprocessed". Hence, I am reposting the question just to be sure (sorry for the multiple emails if both reached you). My question is reagarding t

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 1:29 PM, Jonathan P Daily wrote: Would options(error = recover) be of some help? No, that will probably be very confusing. The problem is that the Windows GUI uses Ctrl-R as a short form of "cut from the editor, paste to the console", and it will paste the whole text regardless

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-08 Thread Dennis Murphy
Hi: After a number of false starts, I finally consulted Deepayan's book and the example on p. 73, suitably adapted, yielded a solution. Add a variable for the labels and then... df$lab <- rep(1:6, each = 3) bwplot(dv ~ f1 | f2, data = df, ylim = c(0.5, 1), panel = function(x, y, ..., subscripts)

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread Jonathan P Daily
Would options(error = recover) be of some help? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do

Re: [R] Quantile Regression and R

2011-04-08 Thread Frank Harrell
Dear Peter, Quantile regression is a nice tool but one that requires some statistical training in order to use it and interpret the results properly. I suggest backing up a bit. Frank Sheldrick, Peter (Specialty Casualty UW Support) wrote: > > Sir or Madam: > > I am new to R and the

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 12:40 PM, William Dunlap wrote: Put an open brace in the first line of your file and a close brace in the last line. This shares an advantage with the method I suggested: if there's a syntax error somewhere in the script, *nothing* will be executed. It has the disadvantage of

Re: [R] plot layout with several plots ON plot area of previous plot

2011-04-08 Thread Greg Snow
Some of the functions that were the first in the TeachingDemos package were originally written to help me visualize something, so it is not just teachers demoing, but people demoing to themselves. It has become a bit of a misc package with several utilities that are useful in themselves, but wh

Re: [R] Fast version of Fisher's Exact Test

2011-04-08 Thread Jim Silverton
Is anyone aware of a fast way of doing fisher's exact test for a series of 2 x 2 tables in R? The fisher.test is really slow if n1=1000 and n2 = 1000. -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list ht

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread William Dunlap
Put an open brace in the first line of your file and a close brace in the last line. I encourage people with scripts long enough that this is a problem to divide up their work into functions that a shorter script calls. (This is akin to UCSD Pascal on the Osbourne II that refused to deal with a f

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 11:47 AM, algorimancer wrote: I too am encountering this problem. When I have a large script, if I select all in the editor and then ctrl-r to run, if it encounters a stop() function it simply prints an error message and continues to execute the remainder of the script, as opposed

Re: [R] help question

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 9:20 AM, DEBERGH Patrick wrote: hello I am at the very beginneing of using the R program I just don't understand how one can save a programfile For exemple, if I type in R 23+456 and want to save this file under a ceratin name to reload it later, i just don't get the way to do

Re: [R] Alignment of lines within barplot bars

2011-04-08 Thread Greg Snow
Look at the updateusr function in the TeachingDemos package. -- 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-bounces@r- > project.org] On Behalf Of

Re: [R] How to *completely* stop a script after stop()?

2011-04-08 Thread algorimancer
I too am encountering this problem. When I have a large script, if I select all in the editor and then ctrl-r to run, if it encounters a stop() function it simply prints an error message and continues to execute the remainder of the script, as opposed to terminating execution at that line. The qu

Re: [R] Windrose Percent Interval Frequencies Are Non Linear! Help!

2011-04-08 Thread Ben Bolker
Brittain Briber yahoo.com> writes: >  Do you two or anyone > else out there happen to know if it is possible to specify the > width of the intervals in windrose?  Is there > a parameter that I can pass along that would do this?  > Below is a reproducible script in which you can see > the uneven

Re: [R] Randomisation tests

2011-04-08 Thread Greg Snow
For simple permutation tests I usually just code it up in regular R without worrying about any packages. R is powerful enough that it is simple to do a permutation test in only a few lines ( or sometimes just one long line). And that way you know exactly what it is doing. -- Gregory (Greg) L

Re: [R] asking about contour plot with R

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 9:16 AM, nferr...@fceia.unr.edu.ar wrote: I'm working in Rosario, Argentina, trying to plot some contours. I found the function "draw.contour" created by James Forester at R-bloggers. If you take a look at that function you'll see it's very useful! But I have a problem with it and

Re: [R] Rpart decision tree

2011-04-08 Thread Achim Zeileis
On Fri, 8 Apr 2011, tudor wrote: Dear useRs: I try to plot an rpart object but cannot get a nice tree structure plot. I am using plot.rpart and text.rpart (please see below) but the branches that connect the nodes overlap the text in the ellipses and rectangles. Is there a way to get a clean

Re: [R] Very simple question

2011-04-08 Thread Ronaldo Reis Junior
Thanks That is it really simple. Ronaldo Em 08-04-2011 07:48, Mario Valle escreveu: > paste(teste, collapse="+") > > ciao! > mario > > On 08-Apr-11 12:44, Ronaldo Reis Junior wrote: >> teste <- c("A","B","C") > -- 1ª lei - Suas férias começam após a defesa e entrega de sua dis

Re: [R] lars - lasso problem

2011-04-08 Thread Steve Lianoglou
Hi, On Fri, Apr 8, 2011 at 10:33 AM, gauri j wrote: > hi, > I have problem in following code, error is occurred. I have attached my data > herewith. and my code is as following, >> library(lars) > Loaded lars 0.9-8 > Warning message: > package 'lars' was built under R version 2.12.2 >> x<- read.t

Re: [R] Estimates at each iteration

2011-04-08 Thread Jonathan P Daily
I'm assuming that English is not your first language. In light of that, I would suggest that you post your question in a language that we both speak: R. Please include: 1) E-step and M-step functions. 2) The proposed optim/maxLik call. Mostly because (at least optim) does not have a parameter c

Re: [R] Removing not duplicated rows

2011-04-08 Thread Chris82
Thanks a lot, Jeremy! It's working perfectly. With best regards -- View this message in context: http://r.789695.n4.nabble.com/Removing-not-duplicated-rows-tp3436600p3436736.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-p

[R] Snow/Snowfall hangs on windows 7

2011-04-08 Thread Anna Ågren
Dear users, I want to set up R to use one R-script directory and one R-library (directory for packages) for many end-users. I try to do this by using one network-share. This works fine as long as we don't use the snowfall package with parallel=TRUE (sfInit(parallel=TRUE, cpus=4, type="SOCK")

[R] problem with my subscription

2011-04-08 Thread Kay Jaja
I have been trying ot post through R-help and it asks me to subscribe. I have subscribed may times but did not get a confirmation. can you check to see what is wrong with my subscription. I can not post on the R-help mailing list at this time. thanks [[alternative HTML version

[R] help question

2011-04-08 Thread DEBERGH Patrick
hello I am at the very beginneing of using the R program I just don't understand how one can save a programfile For exemple, if I type in R 23+456 and want to save this file under a ceratin name to reload it later, i just don't get the way to do it I can save it with the save function;I achei

[R] asking about contour plot with R

2011-04-08 Thread nferreri
I'm working in Rosario, Argentina, trying to plot some contours. I found the function "draw.contour" created by James Forester at R-bloggers. If you take a look at that function you'll see it's very useful! But I have a problem with it and James is trying to help me (but also asked me to seek fo

[R] Time Series Clustering for SAR data

2011-04-08 Thread daveal81
Hi! I'm very new user of R! I need to learn more about! My problems are to create a time series with exiting data and to make an study: 1 ) I have column with DD-MM-YR, to transform from string text to date, and use it as to use as time series, I've made the transformation with command "as.d

[R] Adding text labels to lattice plots with multiple panels

2011-04-08 Thread Jeff Stevens
Hi, I am trying to add text to the bottom of a lattice bwplot with multiple panels. I would like to add a label below each boxplot, but the labels do not come from the data. I've tried the following, code: f1 <- c(rep(c(rep("a", 3), rep("b", 3), rep("c", 3)), 2)) f2 <- c(rep("A", 9), rep("B", 9

[R] Quantile Regression and R

2011-04-08 Thread Sheldrick, Peter (Specialty Casualty UW Support)
Sir or Madam: I am new to R and the use of quantile regeression. In addition, I am a finance person not a true statistcian. Basic regression form is Y = (Coefficient * Variable) + Error Term I have results from a quantile regression where I used the Barro and Roberts method with bootstrapping f

[R] Estimates at each iteration

2011-04-08 Thread hello bye
Dear Sir\ Madam  I am trying to maximise a complicated loglikelihood function  via EM algorithm which consists of two step "E-step and M-step"and in this case I need to maximize the expected of like lihood function " which I get from E- step" and take those estimates of parameter to update the E

Re: [R] Removing not duplicated rows

2011-04-08 Thread Jeremy Hetzel
Sorry, I left out the names() function in the last step. Try this instead: x <- data.frame(cbind(id=c(1,2,2,2,3,3,4,5,6,6), value=1:10)) id.table <- table(x$id) x_new <- subset(x, id %in% names(id.table[id.table > 1])) Jeremy __ R-help@r-project.org mai

[R] multinom() residual deviance

2011-04-08 Thread Sascha Vieweg
Running a binary logit model on the data df <- data.frame(y=sample(letters[1:3], 100, repl=T), x=rnorm(100)) reveals some residual deviance: summary(glm(y ~ ., data=df, family=binomial("logit"))) However, running a multinomial model on that data (multinom, nnet) reveals a residual deviance:

Re: [R] Removing not duplicated rows

2011-04-08 Thread Jeremy Hetzel
As I understand it, you are trying to subset the data frame to include only rows with a non-unique id. Try this: x <- data.frame(cbind(id=c(1,2,2,2,3,3,4,5,6,6), value=1:10)) id.table <- table(x$id) x_new <- subset(x, id %in% id.table[id.table > 1]) Jeremy ___

Re: [R] help with arima time series forecasting

2011-04-08 Thread Berend Hasselman
paul4 wrote: > > Hello all, > > I am new in R language . I want to forecast a univariate time series by > arima model. Could you please help me finding a good document that > describes this problem by a simple example and step by step ? > ?arima and follow the links in the "See also" section

Re: [R] xyplot, groups and colors

2011-04-08 Thread Dennis Murphy
Hi: This seems to 'work': xyplot(circumference~age, dat, groups=Tree, type='l', col.line = c('red', 'blue', 'blue', 'red', 'red')) After a little more fiddling around, this also works, and seems a bit less kludgy: dat$group2 <- factor(dat$group, labels = c('red', 'blue')) xyplot(circu

[R] Removing not duplicated rows

2011-04-08 Thread Chris82
Hello R users, I have a problem to delete rows in a table which are not duplicated in order of an id number a short example: x <- data.frame(cbind(id=c(1,2,2,2,3,3,4,5,6,6), value=1:10)) x_new <- x[which(duplicated(x$id)),] > x_new id value 3 2 3 4 2 4 6 3 6 10 610

Re: [R] Getting number of students with zeroes in long format

2011-04-08 Thread Jorge Ivan Velez
Hi Chris, Sorry for the late response. The following selects all students that have never been suspended: > with(susim, tapply(sus, id_r, function(x) all(x == 0))) 999881 999886 999890 999892 999896 999897 FALSE TRUE TRUE TRUE FALSE TRUE > r <- with(susim, tapply(sus, id_r, function(x

Re: [R] Effects - plot the marginal effect

2011-04-08 Thread John Fox
Dear Tomas, On Fri, 8 Apr 2011 10:24:45 +0200 Tomii wrote: > Thank you for your response, but these changes doesn't seem to change > anything, outcomes of effect command is still the same - error. It's not really possible to help you with so little information; if you send a reproducible examp

Re: [R] Windrose Percent Interval Frequencies Are Non Linear! Help!

2011-04-08 Thread Brittain Briber
Hadley - Thanks for your answers.  I didnt think of it that way and what you say makes complete sense.  Truthfully, however, I dont care to maintain an equal area for each increment.  When discussing frequency distributions on the rose, having a diagram with equally spaced intervals would be mor

Re: [R] Rpart decision tree

2011-04-08 Thread Tal Galili
Hi Tudor, What type of tree did you create? (classification or regression?) Could you give an explanation as to what is not looking nice? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgal

Re: [R] xyplot, groups and colors

2011-04-08 Thread Jeremy Hetzel
Philipp, I would do the following with ggplot2: # Set up data require(ggplot2) dat <- Orange dat$group <- ifelse(dat$Tree%in%c('1','4','5'), 'A', 'B') # Specify the ggplot group aesthetic as Tree g1 <- ggplot(data = dat, aes(x = age, y = circumference, group=Tree)) # Specify the geom_point and

Re: [R] xyplot, groups and colors

2011-04-08 Thread David Winsemius
On Apr 8, 2011, at 8:06 AM, Philipp Pagel wrote: Dear ExpeRts, I am trying to plot a bunch of growth curves and would like to get some more control over groups and line colors than I seem to have. Example: # make some data dat <- Orange dat$group <- ifelse(dat$Tree%in%c('1','4','5')

Re: [R] Avoiding a loop

2011-04-08 Thread jim holtman
Use 'diff' to determine where the changes are: > S <- sample(0:1,30,TRUE) > S [1] 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 1 0 > which(diff(S) == -1) [1] 4 9 13 15 18 21 23 29 > then use the indices for the other processing. On Thu, Apr 7, 2011 at 10:30 PM, Worik R wrote: > Fr

Re: [R] Effects - plot the marginal effect

2011-04-08 Thread David Winsemius
On Apr 8, 2011, at 4:24 AM, Tomii wrote: Thank you for your response, but these changes doesn't seem to change anything, outcomes of effect command is still the same - error. Tomas On Fri, Apr 1, 2011 at 5:03 AM, John Fox wrote: Dear Tomas, Write the model as mreg01 = lm(enep1 ~ enpres *

[R] xyplot, groups and colors

2011-04-08 Thread Philipp Pagel
Dear ExpeRts, I am trying to plot a bunch of growth curves and would like to get some more control over groups and line colors than I seem to have. Example: # make some data dat <- Orange dat$group <- ifelse(dat$Tree%in%c('1','4','5'), 'A', 'B') # plot xyplot(circumference~age, dat, gr

Re: [R] Regrouping data

2011-04-08 Thread Henrique Dallazuanna
Try this: reshape(rat_dat, direction = 'wide', idvar = 'period', timevar = 'name') On Fri, Apr 8, 2011 at 4:44 AM, Sandeepa Ramakrishnan < sandeepa_ramakrish...@yahoo.com> wrote: >Dear R helpers, > > Thanks a lot for your kind help. The xtab function suggested by Mr. > Henrique Dallazua

Re: [R] Variance of random effects: survreg()

2011-04-08 Thread Dennis Murphy
Hi: I didn't see anything on first blush from the mod1 or summary(mod1) objects, but it's not too hard to compute: > names(mod1) [1] "coefficients" "icoef" "var" [4] "var2" "loglik""iter" [7] "linear.predictors" "frail" "fvar" [10] "df"

Re: [R] Sub/Superscript in plot in a loop

2011-04-08 Thread David Winsemius
On Apr 7, 2011, at 9:46 PM, mavkoup wrote: I have a for loop with counter i and I'm producing plots where I ultimately want to label the axes: "Entry a_i from P^q", where a, P and q are just letters, and i is the value of the for loop counter. I've tried various combinations of paste, ex

[R] Rpart decision tree

2011-04-08 Thread tudor
Dear useRs: I try to plot an rpart object but cannot get a nice tree structure plot. I am using plot.rpart and text.rpart (please see below) but the branches that connect the nodes overlap the text in the ellipses and rectangles. Is there a way to get a clean nice tree plot (as in the Rpart Mayo

Re: [R] metaplot

2011-04-08 Thread cheba meier
I installed R 2.12 and it works now, thank you Wolfgang. Servus Cheba > library(metafor) Error: This is R 2.11.0, package 'metafor' needs >= 2.12.0 2011/4/8 cheba meier > I have just installed the package as > > > install.packages("metafor") > --- Please select a CRAN mirror for use in this s

  1   2   >