Re: [R] Plotting Frequency Distribution in R

2008-05-13 Thread tony.sun
x <- read.table(textConnection(" V1 V2 1 1 160.54% 2 1 201.59% 3 1 18.45% 4 1 179.03% 5 1 274.37% 6 1 0.00% 7 1 24.52% 8 1 39.17% 9 3 43.72% 10 1 53.06% 11 1 64.97% 12 1 79.84% 13 1 98.08% 14 1 115.32% 15 1 127.96% 16 1 155.38% 17 1 157.25% 18 1 193.17%

Re: [R] EM Algorithm in R

2008-05-13 Thread Prof Brian Ripley
The EM algorithm is not an algorithm for solving problems, rather an algorithm for creating statistical methods. So you need to look for a package to solve the specific problem you want to solve. In some engineering literature the term is used for its application to finite mixtures of distribu

[R] EM Algorithm in R

2008-05-13 Thread Edward Wijaya
Hi all, Is there any EM (Expectation Maximization) package available for R? CRAN Package archive (http://cran.r-project.org/) doesn't seem to have it. Regards, Edward __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] plot 2 bars

2008-05-13 Thread Yasir Kaheil
try: obs_data<- c(26,43,20,14,18); pre_gam<-c(26.284,61.101,29.016,11.160,11.439) (obs.hist <- hist(obs_data, breaks = 10, plot = FALSE)); plot(obs.hist) plot(obs.hist, border = "dark blue", col = "light blue", xlab ="whatever") (pre.hist <- hist(pre_gam, breaks = 10, plot = FALSE)); lines(pre.his

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Phil Spector
I believe the original poster was looking for runs of consecutive values. Here's a generalization of Tony's solution: findlong = function(seq){ rr = rle(seq) lens = rr$length lens[rr$value == FALSE] = 0 ll = which.max(lens) start = cumsum(c(1,rr$length))[ll] list(start=st

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Tony Plate
If the increases or decreases could be any size, rle(sign(diff(x))) could do it: > x <- c(1, 2, 3, 4, 4, 4, 5, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1) > r <- rle(sign(diff(x))) > r Run Length Encoding lengths: int [1:5] 3 2 2 5 4 values : num [1:5] 1 0 1 -1 0 > i1 <- which(r$lengths==max(r$lengths[r$v

[R] plot 2 bars

2008-05-13 Thread Roslina Zakaria
 Hi r-expert, How do I plot this 2 histogram side by side so that it is easy to compare for bin range 0,5,10,15, 20 and more     obs_data  pre_gam [1,] 2695 2677.284 [2,]   43   61.101 [3,]   20   29.016 [4,]   14   11.160 [5,]   18   11.439 Thanks in advance. _

Re: [R] mfrow

2008-05-13 Thread Steven McKinney
Hi Gusanto, "cex" (for character expansion) arguments can do some of what you want. See if the cex arguments in the first three plots do what you want. See help for plot.default > ?plot.default and ?par for some discussion of cex arguments. pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10)

Re: [R] mfrow

2008-05-13 Thread jim holtman
Which flavor do you want: pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10) y1<-rnorm(10) y2<-rnorm(10,mean=2,sd=1) y3<-rnorm(10,mean=3,sd=1) y4<-rnorm(10,mean=4,sd=1) y5<-rnorm(10,mean=5,sd=1) y6<-rnorm(10,mean=6,sd=1) y7<-rnorm(10,mean=7,sd=1) y8<-rnorm(10,mean=8,sd=1) plot(x,y1,type='o', lty=

Re: [R] The try() function with read.delim().

2008-05-13 Thread Steven McKinney
> -Original Message- > From: [EMAIL PROTECTED] on behalf of Rolf Turner > Sent: Tue 5/13/2008 6:12 PM > To: R help forum > Subject: [R] The try() function with read.delim(). > > > I have written a function which reads data from files using read.delim > (). > The names of these files a

[R] console from tcltk

2008-05-13 Thread Gabor Grothendieck
Is it possible to use the console from within tcltk? > library(tcltk) > tcl("puts", "stdout", "Hello, World") Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class = "tclObj") : [tcl] can not find channel named "stdout". > .Tcl('puts stdout "Hello, World"') Error in structur

[R] The try() function with read.delim().

2008-05-13 Thread Rolf Turner
I have written a function which reads data from files using read.delim (). The names of these files are complicated and are built using arguments to the wrapper function. Since the files in question may or may not exist, I thought to enclose the read.delim() call in a try(): file <-

[R] mfrow

2008-05-13 Thread Agus Susanto
Dear members, I want to create 8 graphs and write it into one page using mfrow=c(4,2). How to make all graphs (including the titles, legends, line types) to be scale down (resized proportionally). As an illustration, below is the code: pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10) y1<-rnorm

Re: [R] Plotting Frequency Distribution in R

2008-05-13 Thread jim holtman
Does something like this do it for you: x <- read.table(textConnection(" V1 V2 1 1 160.54% 2 1 201.59% 3 1 18.45% 4 1 179.03% 5 1 274.37% 6 1 0.00% 7 1 24.52% 8 1 39.17% 9 3 43.72% 10 1 53.06% 11 1 64.97% 12 1 79.84% 13 1 98.08% 14 1 115.32% 15 1 127.96% 16

Re: [R] CRAN and Multiple Linear Regression

2008-05-13 Thread Jorge Ivan Velez
Hi Thomas, Perhaps: test = read.table("test.dat", header=T, dec=',') x <- test[,1:21] y <- test[, "Y"] mymodel <- lm(y ~ x) # Coefficients and more information summary(mymodel) # Plots for the residuals plotspar(mfrow=c(2,2)) plot(mymodel) See also ?lm HTH, Jorge On Tue, May 13,

Re: [R] multiple plots over multiple pages

2008-05-13 Thread jim holtman
Just keep plotting them. You will get additional pages after every four plots. Now I know this is true when using PDF as the output device. On Tue, May 13, 2008 at 5:56 PM, Dirkheld <[EMAIL PROTECTED]> wrote: > > Hi, > > I would like to iterate over a dataframe and plot several graphs over > se

[R] plotting different level of classficifaction

2008-05-13 Thread jiho.han
hello, useRs~ suppose i have a matrix as follows: itemcategory sub-category A 1 11 B 1 12 C 1 12 D 2 21 E 2 22 i like to draw a plot that repre

Re: [R] CRAN and Multiple Linear Regression

2008-05-13 Thread Anja und Th. Sponsel
I just have read the guide and I can do some small steps with cran but I still have no clue... I have data like this: X1 X2 X3 ... X21 Y 1 0 0 0 ... 18 -0,07254 2 1 0 0 ... 6 -0,14921 3 0

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-13 Thread Kingsford Jones
Hi Rolf, On Tue, May 13, 2008 at 1:59 PM, Rolf Turner <[EMAIL PROTECTED]> wrote: < in response to Doug Bates' useful tutorial...> > Thanks very much for your long, detailed, patient, and lucid > response to my cri de coeur. That helps a *great* deal. > Hear Hear! > One point that I'd like

Re: [R] For Social Network Analysis-Graph Analysis - How to convert 2 mode data to 1 mode data?

2008-05-13 Thread Messing, Solomon O.
Hi Gabor, Thank you for your help, and thanks for making the excellent igraph package. The function below seems not generate an edge list that works for my data. I coerced a my data from a data frame using graph.data.frame. You asked in your previous post if 2-mode networks are bipartite. I

[R] Un-reproductibility of SVM classification with 'e1071' libSVM package

2008-05-13 Thread Pierre Dangauthier
Hello, When calling several times the svm() function, I get different results. Do I miss something, or is there some random generation in the C library? In this second hypothesis, is it possible to fix an eventual seed? Thank you Pierre ### Example library('e1071') x = rnorm(100) # train set y

[R] About Iterative Convex Minorant algorithm in R

2008-05-13 Thread rsong
Dear List, Does anybody have R code about Iterative Convex Minorant algorithm for Cox model with interval censored data and be willing to share? The R package intcox works well in simulation, while it has converge problem in a data analysis. Any information are highly appreciated. Thanks, Rui _

[R] multiple plots over multiple pages

2008-05-13 Thread Dirkheld
Hi, I would like to iterate over a dataframe and plot several graphs over several pages. For instance, an iteration over the dataframe will result in 20 plots. Since 20 plots in one page is too much (too many small plots) I would like to distribute them over 5 pages with each 4 plots. I know ho

[R] Question about how to save a txt file in .Rdata or .rda format

2008-05-13 Thread Joanna Dominguez
Hi Everybody, Suppose I have a *txt file*, named "proof" wich I have read it previously using the function *read.table( ). *And suppose I have an algorithm wich requires to load this file "proof" using the function *data ( ) * My problem is the following: how to store the file proof in "*.Rdat

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Marko Milicic
Hi Erik, If you look at first 4 numbers, you will se that there was one increase between first and second number (1 and 2), immediatly after that increase, there is an increase between second and third number (2 and 3) and finaly third consecutive increse between third and fourth number (3 and 4).

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Ingmar Visser
rle(diff(sq)) could be helpful here, best, Ingmar On May 13, 2008, at 11:19 PM, Marko Milicic wrote: Hi all R helpers, I'm trying to comeup with nice and elegant way of "detecting" consecutive increases/decreases in the sequence of numbers. I'm trying with combination of which() and diff(

[R] Max consecutive increase in sequence

2008-05-13 Thread Marko Milicic
Hi all R helpers, I'm trying to comeup with nice and elegant way of "detecting" consecutive increases/decreases in the sequence of numbers. I'm trying with combination of which() and diff() functions but unsuccesifuly. For example: sq <- c(1, 2, 3, 4, 4, 4, 5, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1); I'd

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-13 Thread Rolf Turner
Thanks very much for your long, detailed, patient, and lucid response to my cri de coeur. That helps a *great* deal. I'm not sure that I have a solid understanding of the issues yet --- I never am! --- but I think I'm getting there. I'll need to chew over the posting a bit more and try some ex

Re: [R] upperbound of C index Conf.int. greater than 1

2008-05-13 Thread Frank E Harrell Jr
DAVID ARTETA GARCIA wrote: R-users, I am bootstrapping the C Index of a model created using lrm{Design} and boot{boot}, and I get that the upperbound of the confidence interval is greater than 1. Here is my code: library(HSAUR) data(plasma) ##fit model fit.design <- lrm (ESR ~ fibrinogen

Re: [R] Repeated measures on a split-plot experiment

2008-05-13 Thread Douglas Bates
On Tue, May 13, 2008 at 1:40 PM, James Hudson <[EMAIL PROTECTED]> wrote: > Please advise the proper format for coding the random effects of a > split-plot experiment WITH repeated measures. I have been unable to > figure out how to use either lme or lmer's "grouping" to properly > assign the error

[R] Is there a package assuming a DIRICHLET model for Marketing Consumer Panel

2008-05-13 Thread eugen pircalabelu
Hi List, I was wondering if there is a package in R that uses the DIRICHLET model for panel data like in Goodhart, Ehrenberg, Chatfield 1984. The model uses a combination of distributions and is specifically designed for marketing panel data, using input data such as penetration, brand share,

Re: [R] pch="." plots much faster

2008-05-13 Thread Henrik Bengtsson
FYI, there is also smoothScatter() in the 'geneplotter' package (part of the Bioconductor.org project). /Henrik On Tue, May 13, 2008 at 5:08 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Tue, 13 May 2008, Charles Plessy wrote: > > > > Dear list, > > > > I realised by chance when analysin

Re: [R] 3dscatterplot -different colors for different facto rs of the same variable

2008-05-13 Thread Dieter Menne
Moreno Ignazio Coco sms.ed.ac.uk> writes: > I was trying to do a 3d scatterplot for the following set of datas: > > "obj" "time" "X" "Y" > "1" "yellow" "333" "388.7" "492.3" > "2" "yellow" "567" "388.7" "492.3" > "3" "green" "621" "135.5" "371.7" > "4" "green" "1039" "135.5"

[R] Repeated measures on a split-plot experiment

2008-05-13 Thread James Hudson
Please advise the proper format for coding the random effects of a split-plot experiment WITH repeated measures. I have been unable to figure out how to use either lme or lmer's "grouping" to properly assign the error terms. I am measuring univariate responses. Here is the set-up: WP - whole plot

Re: [R] Bubble plot pie chart map

2008-05-13 Thread Greg Snow
Using just base graphics you can use the floating.pie function from the plotrix package, or the my.symbols function from the TeachingDemos package with your own symbol/plotting function. Pie charts are usually not very useful, there may be another type of symbol (see the symbols function) or pl

Re: [R] Random number generation

2008-05-13 Thread Duncan Murdoch
On 5/13/2008 1:38 PM, Greg Snow wrote: -Original Message- From: Esmail Bonakdarian [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 13, 2008 8:13 AM To: Greg Snow Cc: Prof Brian Ripley; [EMAIL PROTECTED] Subject: Re: [R] Random number generation Greg Snow wrote: >> -Original Message-

Re: [R] Random number generation

2008-05-13 Thread Greg Snow
> -Original Message- > From: Esmail Bonakdarian [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 13, 2008 8:13 AM > To: Greg Snow > Cc: Prof Brian Ripley; [EMAIL PROTECTED] > Subject: Re: [R] Random number generation > > Greg Snow wrote: > >> -Original Message- [snip] > > you could a

[R] ARCH model

2008-05-13 Thread Alberto Monteiro
I have an ARCH model like this: Delta y = y_{t+1} - t_t = k (theta - y_t) Delta t + v_t N(0,1) sqrt(Delta t) where v_t^2 = a_0 + a_1 (y_{t-1} - E[y_{t-1}])^2 Is there any R function that, given a series y_i, determines k, theta, a_0 and a_1 by maximum likelihood? I tried to use garch from t

Re: [R] Problem with odfWeave: Unescaped '<' not allowed in attributes values

2008-05-13 Thread Max Kuhn
Aleksey, > I am using the current version of odfWeave (0.7.5). The thing is, the file > processed just fine in a previous version (0.7.3). Does anyone have any > suggestion how to deal with this? I am now kind of locked since I cannot > reproduce a report I was working on... > What version of

[R] 3dscatterplot -different colors for different factors of the same variable

2008-05-13 Thread Moreno Ignazio Coco
Dear R users, I was trying to do a 3d scatterplot for the following set of datas: "obj" "time" "X" "Y" "1" "yellow" "333" "388.7" "492.3" "2" "yellow" "567" "388.7" "492.3" "3" "green" "621" "135.5" "371.7" "4" "green" "1039" "135.5" "371.7" "5" "red" "1373" "744.1" "205.

[R] RE : Re: details for help needed please

2008-05-13 Thread TEBBI FATIMA
yes and this with other software like hydrolab(hydrology) will take big time and it is a very urgent work . many thanks Jorge Ivan Velez <[EMAIL PROTECTED]> a écrit : Hi Tebbi, Does it mean that you want to simulate your PCA analysis? Thanks, Jorge On Tue, May 13, 2008 at 11:

Re: [R] poisson regression with robust error variance ('eyestud

2008-05-13 Thread Ted Harding
On 13-May-08 14:25:37, Michael Dewey wrote: > At 00:56 09/05/2008, Ted Harding wrote: >>I'd like to thank Paul Johnson and Achim Zeileis heartily >>for their thorough and accurate responses to my query. >> >>I think that the details og how to use the procedure, and >>of its variants, which they hav

Re: [R] Missing coefficient on a glm object

2008-05-13 Thread Prof Brian Ripley
On Tue, 13 May 2008, Diego Cesar wrote: Hello guys, i looked over the archive files and found nothing about this kind of error. It's a feature. I have a database of 33 elements described in 8 variables, i'm using the Leave-One-Out iterative process to take one of the elements to be the test

Re: [R] hessian in constrained optimization (constrOptim)

2008-05-13 Thread Giovanni Petris
See nlme::fdHess HTH, Giovanni > Date: Mon, 12 May 2008 18:18:57 +0100 > From: Carlo Fezzi <[EMAIL PROTECTED]> > Sender: [EMAIL PROTECTED] > Precedence: list > Thread-index: Aci0VENEgf84jUE7T0mEusn0OTj4AA== > > Dear helpers, > > I am using the function "constrOptim" to estimate a model with M

[R] Missing coefficient on a glm object

2008-05-13 Thread Diego Cesar
Hello guys, i looked over the archive files and found nothing about this kind of error. I have a database of 33 elements described in 8 variables, i'm using the Leave-One-Out iterative process to take one of the elements to be the test element and make a regression with the other 32 and then I try

Re: [R] A Very Simple Question

2008-05-13 Thread Giovanni Petris
See ?scale HTH, Giovanni > Date: Tue, 13 May 2008 23:27:59 +0900 > From: Yukihiro Ishii <[EMAIL PROTECTED]> > Sender: [EMAIL PROTECTED] > Precedence: list > DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=ybb20050223; d=ybb.ne.jp; > > Hi Rusers! > > I am ashed of asking such a simple quest

[R] calculating confidence intervals for the turnbull estimate

2008-05-13 Thread Soyeon Kim
Does anyone know of software to calculate confidence intervals for the non-parametric estimate of the survival distribution when data are interval censored, ie, for the Turnbull estimate? Thanks, Soyeon __ R-help@r-project.org mailing list https://stat.

Re: [R] R benchmarking program

2008-05-13 Thread Prof Brian Ripley
The best benchmark is a calculation you really want to do. For most people matrix algebra is an insignificant proportion of what they do in R. A few need complex matrix arithmetic (where compilers and BLAS differ a lot in speed). So there is no universal benchmark. Also, the reference BLAS su

Re: [R] pch="." plots much faster

2008-05-13 Thread Prof Brian Ripley
On Tue, 13 May 2008, Karl Ove Hufthammer wrote: Prof Brian Ripley: matrices, especially given that X11 redraws the plot whenever its window is covered/uncovered by another window, or when I switch virtual desktops. That is a function of your X setup.  R does ask for backing store to be used,

Re: [R] How can one make stepAIC and lme

2008-05-13 Thread Prof Brian Ripley
You are using subset() as a function -- lme has a subset argument, and subset() has non-standard semantics. The dataset you are using is subset(D1,age!=14): it is that which you need to make sure is visible. You didn't make D1 visible, just its columns. On Tue, 13 May 2008, Jorunn Slagstad w

[R] details for help needed please

2008-05-13 Thread TEBBI FATIMA
thank you very much Mr john Kane ,Mr Jorge Ivan Velez i first do an cpa method for my LogNeperien (data hydrology ) (30years of inflows) for 12 months to be sure that my residuals normality will be true in order to reconstitute the 30years of the data with pca in an other way choice of num

Re: [R] R benchmarking program

2008-05-13 Thread Baker D.J.
Hello Philippe, Thank for your reply. I agree that this is an interesting project. As I say we have just started to buy Intel quad core machines after years of offered a service on AMD machines. I recompiled R with the GoTo BLAS, and did some basic tests..things like matrix cross products, solv

Re: [R] A Very Simple Question

2008-05-13 Thread Greg Snow
?sweep -Original Message- From: "Yukihiro Ishii" <[EMAIL PROTECTED]> To: "r-help@r-project.org" Sent: 5/13/08 8:30 AM Subject: [R] A Very Simple Question Hi Rusers! I am ashed of asking such a simple question. X<-matrix(rnorm(24), 4) X0<-apply(X,2,mean) What I want is a matrix which

Re: [R] A Very Simple Question

2008-05-13 Thread Chuck Cleland
On 5/13/2008 10:27 AM, Yukihiro Ishii wrote: Hi Rusers! I am ashed of asking such a simple question. X<-matrix(rnorm(24), 4) X0<-apply(X,2,mean) What I want is a matrix which consists of colums such as X[,1]--X0[1]. X-X0 doesn't work. Perhaps apply function? scale(X, scale=FALSE) ?scale

Re: [R] array dimension changes with assignment

2008-05-13 Thread Duncan Murdoch
On 5/13/2008 12:47 AM, Knut M. Wittkowski wrote: Why does the assignment of a 3178x93 object to another 3178x93 object remove the dimension attribute? Your example is not reproducible. When I make one that is reproducible, I don't see the error: > GT <- array(dim = c(6,3178,93)) > dim(GT) [

[R] Plotting Frequency Distribution in R

2008-05-13 Thread Sachin J
Hi, How can plot a frequency distribution curve for the following data.    V1  V2 1   1 160.54% 2   1 201.59% 3   1  18.45% 4   1 179.03% 5   1 274.37% 6   1   0.00% 7   1  24.52% 8   1  39.17% 9   3  43.72% 10  1  53.06% 11  1  64.97% 12  1  79.84% 13  1  98.08% 14  1 115.32% 15  1 127.96% 1

Re: [R] poisson regression with robust error variance ('eyestudy

2008-05-13 Thread Michael Dewey
At 00:56 09/05/2008, Ted Harding wrote: I'd like to thank Paul Johnson and Achim Zeileis heartily for their thorough and accurate responses to my query. I think that the details og how to use the procedure, and of its variants, which they have sent to the list should be definitive -- and very he

Re: [R] what kind of residuals are the ones calculated in coxph?

2008-05-13 Thread Roland Rau
Hi Karen, those are martingale residuals. You don't have to be a Guru to find it out. Did you check ?coxph Under values it tells you "an object of class "coxph". See coxph.object for details." So you can ask for help for coxph.object ?coxph.object and then you will see among the components: res

Re: [R] Calling C code from R...wrapping C structures

2008-05-13 Thread Duncan Murdoch
On 5/13/2008 7:51 AM, Nathan Harmston wrote: Hi everyone, I am currently trying to call some C code from R, specifically calling a function which populates a C struct. typedef struct{ // contents } Model; void test(Model *m){ // fill the struct with crap } I compile the C code into a sh

[R] A Very Simple Question

2008-05-13 Thread Yukihiro Ishii
Hi Rusers! I am ashed of asking such a simple question. X<-matrix(rnorm(24), 4) X0<-apply(X,2,mean) What I want is a matrix which consists of colums such as X[,1]--X0[1]. X-X0 doesn't work. Perhaps apply function? Thanks in advance. Yukihiro Ishii 2-3-28 Tsurumakiminami, Hadano, 250-0002 Jap

Re: [R] Random number generation

2008-05-13 Thread Karl Ove Hufthammer
Esmail Bonakdarian: >> you could always run your R scripts through the C preproccessor and > > have it strip the block comments for you. > > Too much work, call me old school, but I like the computer do work for me, > rather than the other way around Most editors (and every editor worth using) s

Re: [R] Converting qqplot2 qplot() to grammar?

2008-05-13 Thread hadley wickham
On Mon, May 12, 2008 at 3:31 PM, B. Bogart <[EMAIL PROTECTED]> wrote: > Hello all, > > I've been using the following qplot command: > > qplot(pixX,pixY, data=som, geom="tile", fill=rgb) + > scale_fill_identity() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY) > > Now I would like to conv

[R] R benchmarking program

2008-05-13 Thread Baker D.J.
Hi All, I've just rebuild the latest R with the Goto BLAS on our new Intel quad core machines. I did a few basic matrix calculations, and I was very impressed by the performance I saw. I wonder if anyone has a more rigorous benchmarking program for R. I downloaded a old R test/benchmarking pro

Re: [R] Random number generation

2008-05-13 Thread Esmail Bonakdarian
Greg Snow wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Esmail Bonakdarian Sent: Sunday, May 11, 2008 7:25 AM To: Prof Brian Ripley Cc: [EMAIL PROTECTED] Subject: Re: [R] Random number generation [snip] What I read doesn't seem to be incorrec

Re: [R] R benchmarking program

2008-05-13 Thread Philippe Grosjean
Hello, I did this bechmark test. Perhaps is it a good oppotunity to rewrite it and make it compatible with R 2.7.0, David? Best, Philippe Grosjean ..<°}))>< ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Eco

[R] Problem with odfWeave: Unescaped '<' not allowed in attributes values

2008-05-13 Thread Aleksey Naumov
Dear R users, I am having a problem with odfWeave: when I run odfWeave('notes.odt', 'notes_out.odt') I get a bunch of errors that start with "Unescaped '<' not allowed in attributes values" in post-processing: ... 'content_1.xml' has been Sweaved Removing content.xml Post-processing

Re: [R] Simple regex problem

2008-05-13 Thread John Kane
Thanks to Gabor Grothendieck & Ted Harding. both solutions work very nicely. --- Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try this (no gsub required): > > as.chron(as.Date(xx, "%b %d, %Y")) > > On Sat, May 10, 2008 at 12:49 PM, John Kane > <[EMAIL PROTECTED]> wrote: > > I am cleani

Re: [R] How can one make stepAIC and lme

2008-05-13 Thread Jorunn Slagstad
Hi again, I've tried using with() inside my function in the following manner: library(nlme) library(MASS) PredRes<-function(D1) { with(D1, {lmemod<-lme(distance~age*Sex, random=~1|Subject, data=subset(D1,age!=14), method="ML") themod<-stepAIC(lmemod,dir="both") summary(themod) prs=predict(themod,

Re: [R] Compare columns

2008-05-13 Thread Jorge Ivan Velez
Hi Suhaila, Is this what you want? A=" V1V2 A 1 A 2 A 3 A 4 B 1 B 4 C 1 C 3 D 4" B="V1V2 process1 1 process2 2 process3 3 process4 4" A=read.table(textConnection(A),header=TRUE) B=read.table(textConnection(

Re: [R] pch="." plots much faster

2008-05-13 Thread Karl Ove Hufthammer
Prof Brian Ripley: >> matrices, especially given that X11 redraws the plot whenever its window >> is covered/uncovered by another window, or when I switch virtual >> desktops. > > That is a function of your X setup.  R does ask for backing store to be > used, and so it seeems your setup is not do

[R] Likelihood between observed and predicted response

2008-05-13 Thread Christophe LOOTS
Hi, I've two fitted models, one binomial model with presence-absence data that predicts probability of presence and one gaussian model (normal or log-normal abundances). I would like to evaluate these models not on their capability of adjustment but on their capability of prediction by calcu

[R] Bubble plot pie chart map

2008-05-13 Thread Davidson, D.
Hello, I am currently trying to show the abundance of two species of zooplankton within the North Sea as pie chart bubble plots. I followed Werner Wernersen's advice in R help (http://finzi.psych.upenn.edu/R/Rhelp02a/archive/48644.html) and used Paul Murrell's paper "Integrating Grid Graphics Outp

[R] Calling C code from R...wrapping C structures

2008-05-13 Thread Nathan Harmston
Hi everyone, I am currently trying to call some C code from R, specifically calling a function which populates a C struct. typedef struct{ // contents } Model; void test(Model *m){ // fill the struct with crap } I compile the C code into a shared library, which loads into R properly. My s

[R] R benchmarking program

2008-05-13 Thread Baker D.J.
Hi All, I've just rebuild the latest R with the Goto BLAS on our new Intel quad core machines. I did a few basic matrix calculations, and I was very impressed by the performance I saw. I wonder if anyone has a more rigorous benchmarking program for R. I downloaded a old R test/benchmarking prog

Re: [R] ggplot2: font size mismatch for pdf output

2008-05-13 Thread hadley wickham
> There is a bug in ggsave() for bitmap devices: it computes the width and > height from 'dpi', but it fails to pass that information on to the devices, > which assume 72dpi. So what it actually asked for was a > 8 x 6.67 inch plot at 72dpi. 72dpi would be a better default, as not all > of the

Re: [R] Regular Expressions

2008-05-13 Thread Gabor Grothendieck
On Tue, May 13, 2008 at 5:02 AM, Shubha Vishwanath Karanth <[EMAIL PROTECTED]> wrote: > Suppose, > > S=c("World_is_beautiful", "one_two_three_four","My_book") > > I need to extract the last but one element of the strings. So, my output > should look like: > > Ans=c("is","three","My") > > gsub() ca

[R] upperbound of C index Conf.int. greater than 1

2008-05-13 Thread DAVID ARTETA GARCIA
R-users, I am bootstrapping the C Index of a model created using lrm{Design} and boot{boot}, and I get that the upperbound of the confidence interval is greater than 1. Here is my code: library(HSAUR) data(plasma) ##fit model fit.design <- lrm (ESR ~ fibrinogen + globulin,data=plasma) f

Re: [R] pch="." plots much faster

2008-05-13 Thread Prof Brian Ripley
On Tue, 13 May 2008, Charles Plessy wrote: Dear list, I realised by chance when analysing a 1521862 × 8 matrix that plotting was much faster when using "." as the argument of `pch'. Why is that surprising? Drawing a small square is rather easy compared to a circle, say. I was just wonderi

Re: [R] Remove an object by the reference

2008-05-13 Thread Gabor Csardi
> a <- 1 > x <- "a" > rm(list=x) > a Error: object "a" not found See ?rm for details. Gabor On Tue, May 13, 2008 at 05:13:41PM +0530, Shubha Vishwanath Karanth wrote: > Hi R, > > > > A simple question, but don't know the answer... > > > > x="a" > > a=5 > > > > I need to remove the o

Re: [R] add horizontal line "(ABLINE(V=))" to xyplot lattice

2008-05-13 Thread Richard . Cotton
> In a lattice plot like this: > > win.graph() > xyplot(tmx~frequ|as.factor(as.numeric(spf)),groups=as.factor(blm), > data=tmx,type="l",pch=16,xlab="frequency (N)",ylab="Area held (ha)", > auto.key=list(blm,points=F,lines=T,title="Blm factor",cex.title=0.7, > cex=0.7,corner=c(1,1)),main="Mangroves

Re: [R] Remove an object by the reference

2008-05-13 Thread Richard Pearson
How about rm(list=x)? Richard. Shubha Vishwanath Karanth wrote: Hi R, A simple question, but don't know the answer... x="a" a=5 I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible? Shubha Karanth | Amba Research Ph +91 8

[R] Remove an object by the reference

2008-05-13 Thread Shubha Vishwanath Karanth
Hi R, A simple question, but don't know the answer... x="a" a=5 I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible? Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New Y

Re: [R] test

2008-05-13 Thread Keith Jewell
Hi Everyone, As I expected, posting via the news.gmane.org newsserver with a spam-trap e-mail address (see below) didn't work. I think this post, with my real e-mail address, should work. If so, please accept the apology below! If it does work I'll also find out if the e-mail address obfuscati

[R] pch="." plots much faster

2008-05-13 Thread Charles Plessy
Dear list, I realised by chance when analysing a 1521862 × 8 matrix that plotting was much faster when using "." as the argument of `pch'. I was just wondering if there were other ways to get this speed improvement: it is otherwise quite difficult to explore such big matrices, especially given tha

Re: [R] How to get predicted marginal (aka predicted mean) after multinomial logistic?

2008-05-13 Thread John Fox
Dear monogift, effect() doesn't currently handle mulinom objects. You'll find a paper, some functions, and some example code at for effect displays for multinomial and proportional odds logit models, with standard errors

Re: [R] Left censored responses in mixed effects models

2008-05-13 Thread Richard Cotton
Bert Gunter wrote: > > What is your recommended way of dealing with a left-censored response > (non-detects) in (linear Gaussian) mixed effects models? > > Specifics: Response is a numeric positive measurement (of volume, > actually); > but when it falls below some unknown and slightly random v

Re: [R] test

2008-05-13 Thread Charilaos Skiadas
On May 13, 2008, at 5:52 AM, Esmail Bonakdarian wrote: Tony Plate wrote: You probably should check this section in your R-help subscription options (via https://stat.ethz.ch/mailman/options/r-help/, I think): Receive your own posts to the list? Tony, Like jt I too have it set to receive

Re: [R] test

2008-05-13 Thread Esmail Bonakdarian
Charilaos Skiadas wrote: On May 13, 2008, at 5:52 AM, Esmail Bonakdarian wrote: Tony Plate wrote: You probably should check this section in your R-help subscription options (via https://stat.ethz.ch/mailman/options/r-help/, I think): Receive your own posts to the list? Tony, Like jt I to

[R] help needed please

2008-05-13 Thread TEBBI FATIMA
HI I have a data to test its normality and simulate after how with R. thanks in advance __ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] add horizontal line "(ABLINE(V=))" to xyplot lattice

2008-05-13 Thread pecardoso
Hi, In a lattice plot like this: win.graph() xyplot(tmx~frequ|as.factor(as.numeric(spf)),groups=as.factor(blm),data=tmx,type="l",pch=16,xlab="frequency (N)",ylab="Area held (ha)", auto.key=list(blm,points=F,lines=T,title="Blm factor",cex.title=0.7,cex=0.7,corner=c(1,1)),main="Mangroves target=

Re: [R] Regular Expressions

2008-05-13 Thread Richard . Cotton
> S=c("World_is_beautiful", "one_two_three_four","My_book") > I need to extract the last but one element of the strings. So, my > output should look like: > Ans=c("is","three","My") > gsub() can do this...but wondering how do I give the regular expression sapply(strsplit(S, "_"), functio

Re: [R] Random number generation

2008-05-13 Thread Jim Lemon
On Behalf Of Esmail Bonakdarian wrote: > ... > What I read doesn't seem to be incorrect however (it may even > have been an archived message here), the *language* itself > does not seem to support block *comments*. Using conditional > constructs, or an IDE/editor to achieve similar results is a >

Re: [R] Regular Expressions

2008-05-13 Thread Dimitris Rizopoulos
try this: S <- c("World_is_beautiful", "one_two_three_four","My_book") sapply(strsplit(S, "_"), tail, n = 2)[1, ] # or sapply(strsplit(S, "_"), function(x) x[length(x) - 1]) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic Univer

Re: [R] test

2008-05-13 Thread Esmail Bonakdarian
Tony Plate wrote: You probably should check this section in your R-help subscription options (via https://stat.ethz.ch/mailman/options/r-help/, I think): Receive your own posts to the list? Tony, Like jt I too have it set to receive my own messages, but I too don't see them. I wonder if i

Re: [R] array dimension changes with assignment

2008-05-13 Thread Jeremiah Rounds
>Why does the assignment of a 3178x93 object to >another 3178x93 object remove >the dimension attribute?>> GT <- array(dim = c(6,nrow(InData),ncol(InSNPs)))>> >dim(GT)>[1] 6 3178 93>> SNP1 <- InSNPs[InData[,"C1"],]>> dim(SNP1)>[1] 3178 > 93>> SNP2 <- InSNPs[InData[,"C2"],]>> dim(SNP2)>[1] 31

Re: [R] Format integer

2008-05-13 Thread Esmail Bonakdarian
Anh Tran wrote: Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a string I've tried formatC, but they removes all the zeros and replace it with blanks Hi, try sprintf: >i=13 > cat(sprintf("%05d\n", i)) 00013 > HTH,

[R] Regular Expressions

2008-05-13 Thread Shubha Vishwanath Karanth
Hi R, Again struck with regular expressions... Suppose, S=c("World_is_beautiful", "one_two_three_four","My_book") I need to extract the last but one element of the strings. So, my output should look like: Ans=c("is","three","My") gsub() can do this...but wondering how do I giv

Re: [R] fft: characteristic function to distribution

2008-05-13 Thread Thomas Steiner
Matthias Kohl was so kind and provided me the following lines in this issue: library(distrEx) chf <- function(t, D){ E(D, function(x){exp(1i*t*x)}, useApply = FALSE) } ## Normalverteilung D <- Norm() t <- seq(-3, 3, by = 0.05) chf.norm <- sapply(t, chf, D = D) chf.exakt <- exp(-t^2/2) chf.diff

Re: [R] Permutations

2008-05-13 Thread Stephan Kolassa
Hi Elke, the matrix you are trying to create has 5^21 = 476837158203125 rows and 21 columns. I'm afraid Thierry's proposal with n=21 will not fit into memory. And the file you are writing is 5^21*5*8 bytes big, about 80108643 GB. Perhaps you want to think a little more about what you are trying

Re: [R] ggplot2: font size mismatch for pdf output

2008-05-13 Thread Prof Brian Ripley
If I do windows(width=6, height=5) then the pdf plot is very good copy of what I see on screen. So the main issue seems to be that you changed the device size when you asked for the save. If you do that, you need to change 'pointsize' too -- but as you changed the aspect ratio, you cannot

  1   2   >