Re: [R] how to rotate the histogram

2009-03-12 Thread Yihui Xie
You may refer to the last example in ?layout Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Wed, M

[R] print median and sd...

2009-03-12 Thread johnhj
Hii, Can anybody help me, I don't know how to print the "median". Below is my code snipplet... x <-read.table(file="D:/Uni/Diplom/Diplom/Grafiken/R/BATMAN/Kabel/Batman1hop/Standardabweichung__output_30_1_Kabel(30m)_b.txt") png(filename = "D:/Grafiken/R/Standardabweichung/Kopie.png", width =

Re: [R] How to find maximum values on the density function of arandom variable

2009-03-12 Thread Bert Gunter
There is some considerable confusion in both the question and the reply. rv is **not** a random variable. It is an (iid) sample from (i.e. a "realization" of) a random variable. It has *no* "density function" and the density() function is simply a procedure to **estimate** the density of the unde

Re: [R] Is there any difference between <- and =

2009-03-12 Thread HBaize
I think most people find it odd at first if they have always used "=" but quickly you get use to it and nothing could be more clear. It is explicit. It is active and provides a direction, a value goes into an object. The equal sign for assignment is ambiguous. As an example x = 3 we only kn

Re: [R] Is there any difference between <- and =

2009-03-12 Thread Sean Zhang
Dear Jens and Wacek: I appreciate your answers very much. I came up an example based on your comments. I feel the example helped me to understand...(I could be missing your points though :( ) If so, please let me know. Simon pointed out the following link: http://www.stat.auckland.ac.nz/mail/arch

Re: [R] stats lm() function

2009-03-12 Thread Paul Hermes
ok, i think i have to be more precise of what we are doing. first thing: this code is not from me, and Im new to R (and never touched anything like this) Im just the lucky guy who has to maintain this crap :) this call to the lm function is part of a code wich is used to predict the marketvalue

Re: [R] How to find maximum values on the density function of a random variable

2009-03-12 Thread Mike Lawrence
rv <- rbinom(1,1,0.1) + rnorm(1) d.rv = density(rv) d.x = d.rv$x d.y = d.rv$y d.rv.max = d.rv$x[which.max(d.rv$y)] plot(d.rv) abline(v=d.rv.max) #that what you want? On Thu, Mar 12, 2009 at 6:28 PM, wrote: > I would like to find the maximum values on the density function of a > rando

Re: [R] Is there any difference between <- and =

2009-03-12 Thread Simon Blomberg
I think Venables' and Ripley's convention makes good sense: http://www.stat.auckland.ac.nz/mail/archive/r-downunder/2008-October/000300.html So we not only are explicit about what we are assigning, but where we are assigning it. Cheers, Simon. On Thu, 2009-03-12 at 17:10 -0700, David M Smith w

Re: [R] MANOVA

2009-03-12 Thread Jen_mp3
No, MANOVA is for Multivariate analysis of variance which is used if there are multiple responses as well as variables but you just have one response which is blood pressure. You should just have model <- lm(BP ~Weight+Height) anova(model) If Weight is related to Height only one should be signific

[R] Plots not loading

2009-03-12 Thread Atul Joshi
Hello, When I run my .r script using source (myfilename) from console the plots appear. However, when I execute the same file via terminal command line using R CMD BATCH myfilename, the plots do not appear. I am working with Mac. Am I doing something wrong? Thanks, Atul _

Re: [R] Is there any difference between <- and =

2009-03-12 Thread David M Smith
On Thu, Mar 12, 2009 at 8:29 AM, "Jens Oehlschlägel" wrote: > Thus there is dangerous advice in the referenced blog which reads: > " > f(x <- 3) > which means "assign 3 to x, and call f with the first argument set to the > value 3 > " The thrust of the blog post was the stylistic question of whe

Re: [R] setdiff for data.frames?

2009-03-12 Thread G. Jay Kerns
Dear Jason, On Thu, Mar 12, 2009 at 6:11 PM, Gabor Grothendieck wrote: > Try this: > > library(sqldf) > BODsub <- BOD[1:3,] > sqldf("select * from BOD except select * from BODsub") > > For more see: http://sqldf.googlecode.com > Also, please see http://finzi.psych.upenn.edu/R/R-devel/archive/26

[R] Windows binary version of DPpackage

2009-03-12 Thread Debabrata Midya
Dear R users, Thanks in advance. I am Deb, Statistician at NSW Department of Commerce, Sydney. I am using R 2.8.1 on Windows XP. This has reference to the package “DPpackage”. The binary version is available on Mac OS, but I am using Windows XP. May I request you to assist me in the

[R] Map using projection

2009-03-12 Thread Dr. Alireza Zolfaghari
Hi list, I have a real problem with plotting US state map. When I try to plot the northern state, there will be some blank space in the top of graph (see case 1 example), and when I plot southern states, there will be a blank space in the bottom of plot (see case 2). I spent almost 2 days to figure

Re: [R] regsubsets() [leaps package] - please share some good examples of use

2009-03-12 Thread Tal Galili
Thanks Thomas. Assuming I want to change the "k" factor (used in AIC type procedures), is there a way to do that ? Also - is there a way to force the model to make only one "step" in the creation of the model ? (My aim is to be able to create an adaptive procedure, and I am looking for a way of doi

[R] Time-Ordered Clustering

2009-03-12 Thread Prew, Paul
Hello All, Does anyone know of a package that performs constraint-based clusters? Ideally the package could perform "Time-Ordered Clustering", a technique applied in a recent journal article by Runger, Nelson, Harnish (using MS Excel). Quote, "in our specific implementation of constrained clusteri

[R] Unable to run smoother in qplot() or ggplot() - complains about knots

2009-03-12 Thread Christopher David Desjardins
I get the following error when I run qplot() qplot(grade, read,data = hhm.long.m, geom = c("point", "smooth")) Error in smooth.construct.cr.smooth.spec(object, data, knots) : x has insufficient unique values to support 10 knots: reduce k. I am not sure how to tackle this problem. When I take a

Re: [R] Writing xls - multiple sheets

2009-03-12 Thread Gabor Grothendieck
That was to read worksheet names but its true that the same packages rcom and rdcom can control Excel and therefore write spreadsheets. On Thu, Mar 12, 2009 at 5:52 PM, wrote: >  I think that Gabor sent something earlier today ( or atleast something > related ) so check the archives for his solu

Re: [R] setdiff for data.frames?

2009-03-12 Thread Gabor Grothendieck
Try this: library(sqldf) BODsub <- BOD[1:3,] sqldf("select * from BOD except select * from BODsub") For more see: http://sqldf.googlecode.com On Thu, Mar 12, 2009 at 5:58 PM, Jason Rupert wrote: > > I have two data.frames. > > One is the subset of the other.  I need to determine what rows were

[R] FW: Re: Writing xls - multiple sheets

2009-03-12 Thread markleeds
Jorge was kind enough to point out that I made a mistake in referencing gabor's solution. See below. Thanks Jorge. Begin forwarded message Subject: Re: [R] Writing xls - multiple sheets Date: 3/12/2009 6:03:13 PM From: Jorge Ivan Velez To: markle...@verizon.net Hi Mark,

[R] setdiff for data.frames?

2009-03-12 Thread Jason Rupert
I have two data.frames. One is the subset of the other. I need to determine what rows were removed from the superset data.frame to form the subset data.frame. I was hoping to turn up functionality similar to setdiff for data.frames, but did not have any luck. It seems I need to find a func

Re: [R] Error.bars

2009-03-12 Thread Frank E Harrell Jr
Sueli Rodrigues wrote: Hi, I'm studying the Michael J. Crawley book (Statistics An Introduction using R)and I'm trying to reproduce one example (page 168) for plot a barplot with error bars, but when I put the function I receive the following message. Please, could someone told me what's wrong?

Re: [R] Writing xls - multiple sheets

2009-03-12 Thread markleeds
I think that Gabor sent something earlier today ( or atleast something related ) so check the archives for his solution. On Thu, Mar 12, 2009 at 4:29 PM, Ferry wrote: Hi, Is there a package I can use to write to multiple sheets on xls file, other than using the paid version of xlsReadWri

[R] How to find maximum values on the density function of a random variable

2009-03-12 Thread guox
I would like to find the maximum values on the density function of a random variable. For example, I have a random variable rv <- rbinom(1,1,0.1) + rnorm(1) Its density function is given by density(rv) and can be displayed by plot(density(rv)). How to calculate its maximum values? A densi

Re: [R] Is there any difference between <- and =

2009-03-12 Thread Wacek Kusnierczyk
Jens Oehlschlägel wrote: > Sean, > > >> would like to receive expert opinion to avoid potential trouble >> > [..] > >> i think the following is the most secure way if one really >> really has to do assignment in a function call >>f({a=3}) >> and if one keeps this convention, <- can b

Re: [R] portable R editor

2009-03-12 Thread Werner W.
Unfortunately, the suggested way with JauntePE does not work completely. Maybe I have found a better alternative now: There is a little free application by Sysinternals (now owned by MS) which can create junction points, i.e. a system link to a directory under Windows. It is available here: http:

[R] Writing xls - multiple sheets

2009-03-12 Thread Ferry
Hi, Is there a package I can use to write to multiple sheets on xls file, other than using the paid version of xlsReadWrite package (xlsReadWritePro)? Thank you, Ferry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] R grep & gsub issue - sign seems to be causing an issue...

2009-03-12 Thread Prof Brian Ripley
On Thu, 12 Mar 2009, Duncan Murdoch wrote: Jason Rupert wrote: I would like to use grep and gsub to manipulate a vector to make the names used consistent, i.e. reduce a level or two. This is dangerous: grep and gsub use regular expressions, so a lot of characters (see ?regexp for the list)

Re: [R] stats lm() function

2009-03-12 Thread David Winsemius
I think you will find that many readers of this list would rather try to dissuade you from this misguided strategy. You are unlikely to get to a sensible solution in using step-down procedures with this sort of situation (large number of predictors with modest size of data). -- David Winsem

Re: [R] Removing

2009-03-12 Thread David Winsemius
On Mar 12, 2009, at 3:02 PM, David Winsemius wrote: True, I suppose. The specification from Ma could have been more explicit. Should she want to only have duplicates in sequence, then perhaps the use of construction within the rle function would be useful. act2[ act2$Rep[-1] != act2$Rep[

Re: [R] stats lm() function

2009-03-12 Thread Ravi Varadhan
Look at: ?update For example: lm.obj <- lm (y ~ x1 + ... + x300) lm.obj1 <- update(lm.obj, . ~ . - x1) lm.obj2 <- update(lm.obj1, . ~ . - x2) Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicin

Re: [R] stats lm() function

2009-03-12 Thread Dimitris Rizopoulos
yes, indeed, you can certainly speed things up, by just changing the design matrix X and feeding it back to lm.fit(). In addition, if you just need the least squares estimates, then you gain a bit more by using constructs of the form: XtX <- crossprod(X) Xty <- crossprod(X, y) betas <- solve(

Re: [R] GARCH SIMULATION

2009-03-12 Thread Jurica
You should try installing fGarch package. Then you can simulate various garch models using garchsim command. Hope it help. jurica SUMANTA BASAK-4 wrote: > > Hi All, > > I,m trying to do a GARCH simulation in R 2.3.0 release > in Windows XP. I've seen garchsim function but that is > for garch

Re: [R] R grep & gsub issue - sign seems to be causing an issue...

2009-03-12 Thread Duncan Murdoch
Jason Rupert wrote: I would like to use grep and gsub to manipulate a vector to make the names used consistent, i.e. reduce a level or two. This is dangerous: grep and gsub use regular expressions, so a lot of characters (see ?regexp for the list) have special meanings. For the kind of

[R] stats lm() function

2009-03-12 Thread ph84
Hi, Im using the lm() function where the formula is quite big (300 arguments) and the data is a frame of 3000 values. This is running in a loop where in each step the formula is reduced by one argument, and the lm command is called again (to check which arguments are useful) . This takes 1-2 mi

[R] stats lm() function

2009-03-12 Thread Paul Hermes
Hi, Im using the lm() function where the formula is quite big (300 arguments) and the data is a frame of 3000 values. This is running in a loop where in each step the formula is reduced by one argument, and the lm command is called again (to check which arguments are useful) . This takes 1

[R] New York R Meetup

2009-03-12 Thread Joshua Reich
Hi, After hearing good things about the R community over on the west coast, I have started a New York based R meetup group. We intend to have our first get together on Thursday April 2nd, at 7pm. For more details pop on over to http://meetup.com/nyhackr Regards, Josh -- Joshua Reich 646 256 47

Re: [R] Removing

2009-03-12 Thread David Winsemius
True, I suppose. The specification from Ma could have been more explicit. Should she want to only have duplicates in sequence, then perhaps the use of construction within the rle function would be useful. act2[ act2$Rep[-1] != act2$Rep[-length(act2$Rep)], ] DateDtime Hour Min Se

[R] R grep & gsub issue - sign seems to be causing an issue...

2009-03-12 Thread Jason Rupert
I would like to use grep and gsub to manipulate a vector to make the names used consistent, i.e. reduce a level or two. However, here is what I found when I attempted to use grep and gsub: > tmp_test<-c("House 1 Plot Plus +100","House 2 Plot Plus +100","House 3 Plot > Plus -100","House 4

Re: [R] help with predict and plotting confidence intervals

2009-03-12 Thread Michael Denslow
Thank you for you help Dr. Winsemius. The problem seems to stem from the fact that I have used the incorrect name in the prediction dataframe. The following code seems to work correctly. Thank you again, Michael wt.data <- data.frame(code = factor(LETTERS[1:24]), area = c(60865,480,65

Re: [R] Removing

2009-03-12 Thread Patrick Burns
Simpler, but maybe wrong. Not duplicated was my first response as well, but then I began wondering if the question implied globally duplicated or duplicated within subgroups. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of "The R Inferno" and "A Guide

Re: [R] who can give me some hint?

2009-03-12 Thread William Dunlap
I think I answered a very similar question from you yesterday but perhaps the mail went astray. The subject line is not informative. It may make it easier to think about if you use a function like isFirstInRun <- function(x) c(TRUE, x[-1]!=x[-length(x)] Given a vector x (without NA's in it) it

[R] Cross-validation -> lift curve

2009-03-12 Thread Eric Siegel
Hi all, I'd like to do cross-validation on lm and get the resulting lift curve/table (or, alternatively, the estimates on 100% of my data with which I can get lift). If such a thing doesn't exist, could it be derived using cv.lm, or would we need to start from scratch? Thanks! -- Eric Siegel,

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Ravi Varadhan
?try For example, for (i in 1:n) { try (fit <- nls(...), silent=TRUE) if (class(fit) != "try-error") dowhateverthatneedstobedonewiththeresults else fit <- NA } Ravi. --- Ravi Varadhan, Ph.D. Assistant P

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Gabor Grothendieck
If the goal here is to repeatedly run a particular model from different starting values then the nls2 package will do that for you. On Thu, Mar 12, 2009 at 2:13 PM, Bill Shipley wrote: > Hello.  I have a script in which I repeatedly fit a nonlinear regression to > a series of data sets using nls

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Joshua Reich
Hi Bill, You should have a look at the try() function that lets you enclose an expression and handle failure in a way that prevents the entire execution from halting. Josh On Thu, Mar 12, 2009 at 1:13 PM, Bill Shipley wrote: > Hello. I have a script in which I repeatedly fit a nonlinear regres

[R] avoiding termination of nls given convergence failure

2009-03-12 Thread Bill Shipley
Hello. I have a script in which I repeatedly fit a nonlinear regression to a series of data sets using nls and the port algorithm from within a loop. The general structure of the loop is: for(i in 1:n){ … extract relevant vectors of dependent and independent variables … … estimate starting val

[R] nested logit estimation

2009-03-12 Thread justin bem
Dear all, Is there a function to fit nested logit available somewhere ? Sincerly  Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] debug

2009-03-12 Thread Duncan Murdoch
Tammy Ma wrote: Hi, All I have so many files in my directory. I got the following error. At this time, I couldn't use debug() to check error one by one because so many files getting invloved. How can I get some idea about my error?? The usual advice: simplify the problem until it's obvio

Re: [R] can I draw 3D plot like this using R?

2009-03-12 Thread Oliver
Thank you all for the suggestions and answers. Oliver On Mar 12, 6:51 am, Duncan Murdoch wrote: > On 11/03/2009 11:35 PM, Oliver wrote: > > > hi, all > > > I am looking at R package RGL to draw a colored mesh/surface plot like > > this one (from matlab). > >http://www.mathworks.com/access/helpde

[R] debug

2009-03-12 Thread Tammy Ma
Hi, All I have so many files in my directory. I got the following error. At this time, I couldn't use debug() to check error one by one because so many files getting invloved. How can I get some idea about my error?? . Skipping book_log-20060222T143612.txt Skipping book_log-20060222T162

[R] How to replace a pair of observations in a matrix?

2009-03-12 Thread WXE83
Dear all, I did this replacement below and its work for the first case but not in the second case! Please tell me what's wrong with the second case. Case 1: > m [,1] [,2] [1,]14 [2,]25 [3,]36 > l [,1] [,2] [1,]9 10 > matric1<-replace(m,m[3,],l) > ma

Re: [R] batch process file in R

2009-03-12 Thread Derek Norton
If these are the only files in the directory, then you might try... (File paths will need to change if the folder "200209" isn't in the working directory) fpath <- "./200209" a <- list.files(fpath) for(i in 1:length(a)){ assign(paste("y",i,sep=""),read.table(paste(fpath,a[i],sep="/"))) } Ano

[R] Seemingly unrelated model with spatial processes

2009-03-12 Thread ArunPrasad
Hello everyone, Do we have package in R which will estimates the parameter in Seemingly Unrelated Spatial Regression Model? Any help would be appreciated. Thanks Arun -- View this message in context: http://www.nabble.com/Seemingly-unrelated-model-with-spatial-processes-tp22478913p22

Re: [R] help with predict and plotting confidence intervals

2009-03-12 Thread David Winsemius
On Mar 12, 2009, at 11:45 AM, David Winsemius wrote: On Mar 12, 2009, at 11:14 AM, Michael Denslow wrote: # I am not sure how to get the lines to draw correctly here matlines(pred.frame$a,pp, lty=c(1,2,2),col="black") The x values are your sequence whereas the y values are in the sequen

[R] runs.test question

2009-03-12 Thread Ista Zahn
Hi everyone, I have data from an experiment in which human participants were instructed to generate a random sequence of yes/no answers under 4 different conditions. I want to test how successful they were in doing this. More specifically, I want to test the null hypothesis that the 4 conditions co

Re: [R] eps/pdf write help

2009-03-12 Thread Philipp Pagel
On Thu, Mar 12, 2009 at 03:06:30PM +, Mohan Singh wrote: > I am trying to print graphs as pdf's or eps in a for loop, but I can't seem > to get it right > > > > Either it prints only a single eps graph (overwrites) or when I use > #pdf(paste(i,".pdf", sep="")) .. it prints all pdf's but the

Re: [R] help with predict and plotting confidence intervals

2009-03-12 Thread David Winsemius
On Mar 12, 2009, at 11:14 AM, Michael Denslow wrote: Dear R help, This seems to be a commonly asked question and I am able to run examples that have been proposed, but I can't seems to get this to work with my own data. Reproducible code is below. Thank you in advance for any help you c

Re: [R] Is there any difference between <- and =

2009-03-12 Thread Jens Oehlschlägel
Sean, > would like to receive expert opinion to avoid potential trouble [..] > i think the following is the most secure way if one really > really has to do assignment in a function call >f({a=3}) > and if one keeps this convention, <- can be dropped altogether. secure is relative, since due

Re: [R] R-help: grep in for loop using index - doesn't work

2009-03-12 Thread baptiste auguie
Hi, your example is quite messy (neither reproducible or minimal). I think you could try the following, mdf <- data.frame(1:3) names(mdf) <- "147" i <- 147 mdf[ as.character(i) ] Hope this helps, baptiste On 11 Mar 2009, at 22:34, Mohan Singh wrote: Hi everyone I am trying to

Re: [R] matrix multiplication, tensor product, block-diagonal and fast computation

2009-03-12 Thread Charles C. Berry
On Wed, 11 Mar 2009, Camarda, Carlo Giovanni wrote: Dear R-users, I am searching to the "best" way to compute a series of n matrix multiplications between each matrix (mXm) in an array (mXmXn), and each column of a matrix (mXn). Please find below an example with four possible solutions. The fi

[R] help with predict and plotting confidence intervals

2009-03-12 Thread Michael Denslow
Dear R help, This seems to be a commonly asked question and I am able to run examples that have been proposed, but I can't seems to get this to work with my own data. Reproducible code is below. Thank you in advance for any help you can provide. The main problem is that I can not get the confi

Re: [R] Easy "Recall" to get ls(..., all.names=TRUE)?

2009-03-12 Thread Szumiloski, John
-Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: Wednesday, 11 March, 2009 5:09 PM To: Szumiloski, John Cc: r-help@r-project.org Subject: Re: [R] Easy "Recall" to get ls(..., all.names=TRUE)? On 12/03/2009, at 3:16 AM, Szumiloski, John wrote: > Dear useRs,

[R] eps/pdf write help

2009-03-12 Thread Mohan Singh
I am trying to print graphs as pdf's or eps in a for loop, but I can't seem to get it right Either it prints only a single eps graph (overwrites) or when I use #pdf(paste(i,".pdf", sep="")) .. it prints all pdf's but they are empty Can someone suggest which method shud I use for such. T

Re: [R] alternative to EMV?

2009-03-12 Thread David Winsemius
If I understand your question and if I understood Dr Harrell's description of the Hmisc/Design packages capabilities, this should all be available. I have been blessed with a dataset so large and with so relatively few missing values that I have not yet needed to put his methods into practi

Re: [R] read.xls and name of worksheet

2009-03-12 Thread Gabor Grothendieck
Here is a program that will get a list of the sheet names and then read in the indicated name. Modify to suit. library(rcom) xls <- "C:\\test.xls" oxl <- comCreateObject('Excel.Application') comSetProperty(oxl, "Visible", TRUE) owb <- comGetProperty(oxl, "Workbooks") ob <- comInvoke(owb, "Open",

[R] read.xls and name of worksheet

2009-03-12 Thread Juergen Rose
Hi, I would like to some excel files with some worksheets. I tried this with the following R script: library(gdata) i<-1 rc<-0 while(rc != "try-error") { wksh<-try(read.xls("cluster-microarray-FW.xls",sheet=i,verbose=TRUE,perl="perl")) rc<-class(wksh) print(sprintf("--- i=%2d rc=%s -

[R] model simplification in lme

2009-03-12 Thread Menelaos Stavrinides
Model simplification in lme Pinheiro and Bates suggest that model simplification of fixed effects in lme with anova (model,model2) is anticonservative. What is the best way to simplify a model in lme? Testing the p value for each fixed factor with anova (model, type="marginal") and removing it if i

Re: [R] full screen graph, and close x11

2009-03-12 Thread Eik Vettorazzi
Hi, see ?dev.off but I think (guessing you use a windows system), you would be better of in using win.metafile() instead of x11() in initiating the graph, see ?win.metafile There is no need to show all 100+ graphs on your display if you actually want them in files. hth. BaKaLeGuM schrieb: Hi

Re: [R] set size of a plot

2009-03-12 Thread Christos Hatzis
See ?pdf and its width and height arguments. Also if you want to have the graph centered on a standard page, there are additional arguments to help you achieve that effect: > pdf("test.pdf", height=5, width=5, paper="letter", pagecentre=TRUE) > hist(rcauchy(100)) > dev.off() -Christos > -Or

Re: [R] Removing

2009-03-12 Thread David Winsemius
Much simpler would be: act2[!duplicated(act2$Rep),] #use the negation of the duplicated function on $Rep and indexing DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 58

Re: [R] MANOVA

2009-03-12 Thread David Winsemius
Another method would be to use a summary that incorporates both as a measure of obesity, In medical investigations it is common to use the BMI which is the ratio of (weight in Kg) to (height in meters squared). Yet a third method would be to investigate for nonlinearity on the response func

Re: [R] set size of a plot

2009-03-12 Thread Sarah Goslee
Set which size? Of the page? - then you need to specify in pdf(). Of the plot margins? - then par$mai Of something else? Then you need to be more specific about your intention. Sarah On Thu, Mar 12, 2009 at 10:05 AM, Maxl18 wrote: > > Hi, > I have the following R-code: > > pdf(file="test.pdf") >

Re: [R] regsubsets() [leaps package] - please share some good examples of use

2009-03-12 Thread Thomas Lumley
If you run the example from ?biglm data(trees) ff<-log(Volume)~log(Girth)+log(Height) chunk1<-trees[1:10,] chunk2<-trees[11:20,] chunk3<-trees[21:31,] a <- biglm(ff,chunk1) a <- update(a,chunk2) a <- update(a,chunk3) summary(a) you can then do b <-regsubsets(a, method="forward") summary(b) to

Re: [R] set size of a plot

2009-03-12 Thread ONKELINX, Thierry
?pdf reads: width, height the width and height of the graphics region in inches. The default values are 7. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel bio

Re: [R] CI from svyquantile in survey package

2009-03-12 Thread Thomas Lumley
This is a consequence of changes made to support multiple imputation, where extracting the standard errors was needed. I will try to fix it. A work-around is to use lapply() and subset() lapply(c("E","M","H"), function(s) svyquantile(~api99,subset(dclus1, stype==s), ci=TRUE,quantiles=0.5))

[R] GARCH variance equation with dummy variables

2009-03-12 Thread Brajkovic J.
I am estimating daily electricity prices using GARCH (1,1). What I would like to see is whether there is some kind of daily or seasonal effect in variance of the price series. For instance, variance of electricity prices might be different (higher) during weekdays as opposed to during weekend. T

[R] set size of a plot

2009-03-12 Thread Maxl18
Hi, I have the following R-code: pdf(file="test.pdf") hist(rcauchy(100)) dev.off() How can I set the size of the histogram in my pdf? I tried to do with par(...) but I didn't find the right parameter yet. Thanks, Max -- View this message in context: http://www.nabble.com/set-size-of-a-plot-tp

Re: [R] zooreg and lmrob problem (bug?)

2009-03-12 Thread Gabor Grothendieck
One can't assume an arbitrary function necessarily works with zoo objects although many do; however, for functions that are sufficiently similar to lm, like lmrob, dyn in the dyn package can transform it to work with zoo (as well as with ts and a number of other time series classes). Just preface l

Re: [R] batch process file in R

2009-03-12 Thread Jorge Ivan Velez
Dear Ted, Try this: # Working directory -- files are located here setwd("C:\\200209") # Names of the files Files<-c( paste("BA02090",c(2:6,9),".txt",sep=""), paste("BA0209",c(10:13,16:20,23:27,30),".txt",sep=""), "GMAS0209.txt","MAST0209.txt" ) Files # Reading the files into R Re

Re: [R] batch process file in R

2009-03-12 Thread Romain Francois
tedzzx wrote: Dear R experts, I have a folder names "200209" and in this folder there are many data files, such as: "BA020902.txt","BA020903.txt","BA020904.txt", "BA020905.txt","BA020906.txt","BA020909.txt", "BA020910.txt","BA020911.txt","BA020912.txt", "BA020913.txt","BA020916.txt","BA020917.

Re: [R] help with loop

2009-03-12 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > is your data a data frame or a matrix? do you want to compute the > differences columnwise, i.e., for each column independently? consider > this example: > > # generate and display dummy data > (d = as.data.frame(replicate(3, sample(5 > > # compute succe

Re: [R] help with loop

2009-03-12 Thread Rafael Moral
Thank you guys, it's a lot simpler than I thought. Regards, Rafael. Veja quais são os assuntos do momento no Yahoo! +Buscados [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] Pseudo-random numbers between two numbers

2009-03-12 Thread Berwin A Turlach
On Wed, 11 Mar 2009 06:57:02 -0400 Duncan Murdoch wrote: > g...@ucalgary.ca wrote: > > Please forget the last email I sent with the same subject. > > = > > I would like to generate pseudo-random numbers between two numbers > > using R, up to a given distribution, > > for instance,

[R] R an .net

2009-03-12 Thread Daniele Amberti
Does anyone knows about the possibility to use Microsoft .net runtime (or mono) from R (like RJava for Java)? Thanks in advance Daniele ORS Srl Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy Tel. +39 0173 620211 Fax. +39 0173 620299 / +39 0173 433111 Web Site

Re: [R] Couple of Questions about Classification trees

2009-03-12 Thread Ed Merkle
The issue with the sample size is that there are so many measurements in comparison to number of meats. Aside from that, you should check out the rpart package. Its commands are similar to the tree package, but there are more options for the plots. I don't know immediately how to display mis

[R] 'netalg' and 'netlab' packages neural networks

2009-03-12 Thread Sály Péter
Dear List, I have just started to familiarize with artificial neural networks and I find two names of packages by chance using R search. But unfortunately I can not find these packages on the CRAN. Is it possible that they were renamed? The names of the packages in question are: netalg netla

[R] alternative to EMV?

2009-03-12 Thread Elsaesser, Chris
I need a package that can compute missing values of n-dimensional vectors for n > 2. This is a kind of interpolation, complicated in dimensions higher than 2. The idea is that I have a set of fully specified vectors (i.e., with no missing values) and I get a new vector that has one or more missi

Re: [R] Partial function application in R

2009-03-12 Thread nosek
Sorry for not answering long. After working a lot with new version of "bind" function I find it actually really useful. Just to avoid any possible hard-to-debug errors I try to stick to some good practices, like always specifying default values for formal parameters and calling "bind" with named a

[R] zooreg and lmrob problem (bug?)

2009-03-12 Thread Víctor Homar
Hi all and thanks for your time in advance, I can't figure out why summary.lmrob complains when lmrob is used on a zooreg object. If the zooreg object is converted to vector before calling lmrob, no problems appear. Let me clarify this with an example: >library(robustbase) >library(zoo) >dad<-c(

[R] How to install R-2.8.1 on AIX

2009-03-12 Thread 王峰
Hi: I can't install the R-2.8.1 on the machine IBM AIX according the instruction configuratioin(OBJECT_MODE=64). I can successfully ./configure ***, and get a Makefile. But during compiling the source code, there is some problem I can't fix it. Please tell me some tips about "how to inst

[R] Randomization, line and spatial coordinates

2009-03-12 Thread PLAFF
Hi all, I would like to know how to create n equidistant random points along a multisegment line/object of class psp and to retrieve the coordinates of those generated random points. thanks P.L. -- View this message in context: http://www.nabble.com/Randomization%2C-line-and-spatial-coordina

[R] batch process file in R

2009-03-12 Thread tedzzx
Dear R experts, I have a folder names "200209" and in this folder there are many data files, such as: "BA020902.txt","BA020903.txt","BA020904.txt", "BA020905.txt","BA020906.txt","BA020909.txt", "BA020910.txt","BA020911.txt","BA020912.txt", "BA020913.txt","BA020916.txt","BA020917.txt", "BA020918.

Re: [R] help with loop

2009-03-12 Thread baptiste auguie
On 12 Mar 2009, at 13:22, richard.cot...@hsl.gov.uk wrote: I'm trying to write a loop to sum my data in the following way: (the second - the first) + (the third - the second) + (the fourth - the third) + ... for each column. This is just sum(diff(x)), or even x[length(x)] - x[1]. I think r

Re: [R] help with loop

2009-03-12 Thread Jorge Ivan Velez
Dear Rafael, Perhaps: sum(diff(x)) where x is your vector. To apply above to your data set (by rows), you could use apply(mydata,1,function(x) sum(diff(x))) See ?diff, ?sum and ?apply for more information. HTH, Jorge On Thu, Mar 12, 2009 at 9:04 AM, Rafael Moral wrote: > Dear useRs, > I'm

Re: [R] help with loop

2009-03-12 Thread Gabor Grothendieck
This is a telescoping sum that can be calculated analytically as: (a[2] - a[1]) + ... + (a[n] - a[n-1]) = a[n] - a[1] On Thu, Mar 12, 2009 at 9:04 AM, Rafael Moral wrote: > Dear useRs, > I'm trying to write a loop to sum my data in the following way: > (the second - the first) + (the third - t

Re: [R] help with loop

2009-03-12 Thread Romain Francois
Well actually, what about that (Assuming mydata is a data frame) tail( mydata, 1 ) - head( mydata, 1) since: (the second - the first) + (the third - the second) + (the fourth - the third) = the last - the first Romain Rafael Moral wrote: Dear useRs, I'm trying to write a loop to sum my data

Re: [R] help with loop

2009-03-12 Thread Richard . Cotton
> I'm trying to write a loop to sum my data in the following way: > (the second - the first) + (the third - the second) + (the fourth - > the third) + ... > for each column. This is just sum(diff(x)), or even x[length(x)] - x[1]. Regards, Richie. Mathematical Sciences Unit HSL ---

Re: [R] help with loop

2009-03-12 Thread Romain Francois
Hi, Try this; lapply( mydata, function(x){ sum( diff( x ) ) } ) Romain Rafael Moral wrote: Dear useRs, I'm trying to write a loop to sum my data in the following way: (the second - the first) + (the third - the second) + (the fourth - the third) + ... for each column. So, I wrote someth

Re: [R] help with loop

2009-03-12 Thread Wacek Kusnierczyk
is your data a data frame or a matrix? do you want to compute the differences columnwise, i.e., for each column independently? consider this example: # generate and display dummy data (d = as.data.frame(replicate(3, sample(5 # compute successive differences columnwise as.dat

  1   2   >