Re: [R] Can't find -lg2c when installing randomForest

2009-01-20 Thread Prof Brian Ripley
How did you install R? This looks like an issue where R was built wiht g77 bu that is no longer present. A system using gcc 4.1.2 should be using gfortran not g77 (for compatibility). R 2.7.1 is obsolete: I suggest you install a current R from the sources (or a source RPM). On Tue, 20 Ja

[R] A question on histogram (hist): coordinates on x-axis are too sparse

2009-01-20 Thread Li, Hua
Dear R helpers: Let's say I have some data X, X <- runif(1000, 1, 100) pdf('X.pdf', width=100,height=5) hist(X, breaks=1000) dev.off() I find that, on x-axis the coordinates are 0e+00, 2e+09, 4e+09, 6e+09, 8e+09, 1e+10. Only five numbers, which is too s

[R] problem with rbind

2009-01-20 Thread SNN
Hi All, I have a problem with rbind. I have data that consist of weight height .. etc of 1000 patients. I would like to find the mean and the standard deviation ( for the weight , height etc) for each gender. data<-read.table("data.txt", header=T, sep='\t') fdata=NULL for (i in 1:50){ nn<-na

[R] trouble converting an array to a dataframe

2009-01-20 Thread Christopher W. Ryan
I start with a dataframe called xrays. It contains scores on films from each of two radiologists. It is in "long" format. I used the reshape package to melt a data frame and then cast it into "wide" format, one line for each patient (identified by redlognumb) with scores from both radiologists for

Re: [R] Concave Hull

2009-01-20 Thread roger koenker
Actually, I think that the survey on "alpha shapes" available from: http://www.cs.duke.edu/~edels/Surveys/ would be more closely aligned with what Michael was interested in... url:www.econ.uiuc.edu/~rogerRoger Koenker email rkoen...@uiuc.edu

[R] Serious difference between the result of ADF test in R and Eviews

2009-01-20 Thread RON70
I found there is serious difference between the result of ADF test in R and Eviews, for this data : > dat V1 1 -0.075851693 2 -0.046125504 3 -0.009117161 4 0.025569817 5 0.034882743 6 0.073671497 7 0.063805297 8 0.062306796 9 0.072343820 10 0.058354121 11 -0.007635359

[R] Handling of factors

2009-01-20 Thread Stavros Macrakis
I'm rather confused by the semantics of factors. When applied to factors, some functions (whose results are elements of the original factor argument) return results of class factor, some return integer vectors, some return character vectors, some give errors. I understand some but not all of this

[R] Text Outside Lattice Plot

2009-01-20 Thread jimdare
Dear R users I created the graph at the bottom using xyplot in the lattice package. I added a title using the main="Title" command in xyplot, however it is plotted too close to the legend for my liking. To remedy this I increased the upper margin of the plot using plot(data, position = c(0,0,1

Re: [R] tclarray with embedded spaces in data

2009-01-20 Thread Peter Dalgaard
Ruth M. Ripley wrote: I would like to use a tclArray: mytkarray <- tclArray() as the variable for a table: table1 <- tkwidget(f1, 'table', variable= mytkarray) but if I include character strings with embedded spaces, I get braces appearing in the table. I can remove them using a non-R tclarr

Re: [R] Concave Hull

2009-01-20 Thread David Winsemius
The OP was asking whether concave hulls have been implemented. He wasn't very helpful with his link giving the example, since it was to the "outside" of a frame-based website. Perhaps this link (see the bottom of that page) will be more helpful: http://get.dsi.uminho.pt/local/results.html

Re: [R] Problem with subset() function?

2009-01-20 Thread Steven McKinney
D'oh! My apologies for the noise. I thought I had verified class from the str() output the user was showing me. > class(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age))) [1] "data.frame" > class(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age), drop = TRUE)) [1] "integer" > cl

Re: [R] Poisson GLM

2009-01-20 Thread bbbnc
I thought that quasipoisson family was used to model overdispersion, since the dispersion parameter isn't fixed at one. Could you please elaborate a little about why quasipoisson is more suitable for this non-integer poisson data? also, is it significant that vcov shows a difference? -- View

[R] trouble switching to 'plm' from 'xtabond' and Stata

2009-01-20 Thread Aaron M. Swoboda
Hello, I am switching to R from Stata and I am having particular trouble with the transition from Stata's 'xtabond' and 'ivreg' commands to the "plm" package. I am trying to replicate some of the dynamic panel data work using the UK Employment data in Arellano and Bond (1991) and availabl

[R] Can't find -lg2c when installing randomForest

2009-01-20 Thread Richard Yanicky
I have search the help archives and can't find a direct reference to the following issue: When installing randomForest on under CentOS 5.2 , R version 2.7.1 with gcc 4.1.2. We receive the following error (see below, can't find –lg2c) it is in the path! r...@abcsci12 ~]# R CMD INSTALL /scis

[R] arima.sim help

2009-01-20 Thread granitemathematics
I am trying to simulate time series data for an ar(1) and ma(1) process. I want the error term to have either a t distribution with 1 degree of freedom or a normal distribution with mean=0 and sd=1. Here is my code: error.model=function(n){rnorm(n,mean=0, sd=1)} data<-arima.sim(model=list(ar=

[R] tclarray with embedded spaces in data

2009-01-20 Thread Ruth M. Ripley
I would like to use a tclArray: mytkarray <- tclArray() as the variable for a table: table1 <- tkwidget(f1, 'table', variable= mytkarray) but if I include character strings with embedded spaces, I get braces appearing in the table. I can remove them using a non-R tclarray, (the difference betw

Re: [R] problem with apply(m, 1, min, na.rm=T)

2009-01-20 Thread Marc Schwartz
on 01/20/2009 05:26 PM Czerminski, Ryszard wrote: > Passing extra arguments to FUN=mean or median in apply > seems fine, but when FUN=min warnings are generated? > See below. > > Any ideas why? > > Best regards, > Ryszard > > Ryszard Czerminski > AstraZeneca Pharmaceuticals LP > >> m > [,

Re: [R] Concave Hull

2009-01-20 Thread Charles Geyer
> Message: 64 > Date: Mon, 19 Jan 2009 15:14:34 -0700 > From: Greg Snow > Subject: Re: [R] Concave Hull > To: Michael Kubovy , r-help > > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > I don't know if it is the same algorithm or not, but there is the function > "c

Re: [R] problem with apply(m, 1, min, na.rm=T)

2009-01-20 Thread Rolf Turner
On 21/01/2009, at 12:26 PM, Czerminski, Ryszard wrote: Passing extra arguments to FUN=mean or median in apply seems fine, but when FUN=min warnings are generated? See below. Any ideas why? Best regards, Ryszard Ryszard Czerminski AstraZeneca Pharmaceuticals LP m [,1] [,2] [1,]1

[R] Problem with cyrillic in postscript

2009-01-20 Thread Alexander Nakhabov
Hi all, When I plot some graph with cyrillic (namely russian) titles it looks ok, but after saving this figure as eps file I get damaged title fonts. The command dev.copy2eps was used in the following manner: dev.copy2eps("test.eps") or, for example dev.copy2eps("test.eps",family='NimbusSan') What

[R] problem with apply(m, 1, min, na.rm=T)

2009-01-20 Thread Czerminski, Ryszard
Passing extra arguments to FUN=mean or median in apply seems fine, but when FUN=min warnings are generated? See below. Any ideas why? Best regards, Ryszard Ryszard Czerminski AstraZeneca Pharmaceuticals LP > m [,1] [,2] [1,]12 [2,]3 NA [3,] NA NA > apply(m, 1, median, na

Re: [R] Problem with subset() function?

2009-01-20 Thread David Winsemius
Consider an alternative and realize that it is density() that is complaining about being passed a dataframe rather than subset misbehaving: density(subset(mydf, ht >= 150.0 & wt <= 150.0)$age) Call: density.default(x = subset(mydf, ht >= 150 & wt <= 150)$age) Data: subset(mydf, ht >

Re: [R] Problem with subset() function?

2009-01-20 Thread Marc Schwartz
on 01/20/2009 05:02 PM Steven McKinney wrote: > Hi all, > > Can anyone explain why the following use of > the subset() function produces a different > outcome than the use of the "[" extractor? > > The subset() function as used in > > density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(a

Re: [R] Problem with subset() function?

2009-01-20 Thread Andrew Robinson
Steven, check the class of the objects that you are creating. Cheers, Andrew On Wed, January 21, 2009 10:02 am, Steven McKinney wrote: > Hi all, > > Can anyone explain why the following use of > the subset() function produces a different > outcome than the use of the "[" extractor? > > The subs

Re: [R] Odd behaviour of subset indexing (x:y).

2009-01-20 Thread Marc Schwartz
on 01/20/2009 05:01 PM John Sorkin wrote: > R 2.8.1 > windows XP > > I don't understand the output from x[iS+1:iE] produced by the code below: > > x = c(1,2,3,4,5) > x > [1] 1 2 3 4 5 > > iS=2 # start position > iE=4 # end position > > [iS:iE] > [1] 2 3 4 > > # I don't understand the

[R] Problem with subset() function?

2009-01-20 Thread Steven McKinney
Hi all, Can anyone explain why the following use of the subset() function produces a different outcome than the use of the "[" extractor? The subset() function as used in density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age))) appears to me from documentation to be equivalent to de

[R] Odd behaviour of subset indexing (x:y).

2009-01-20 Thread John Sorkin
R 2.8.1 windows XP I don't understand the output from x[iS+1:iE] produced by the code below: x = c(1,2,3,4,5) x [1] 1 2 3 4 5 iS=2 # start position iE=4 # end position [iS:iE] [1] 2 3 4 # I don't understand the results of the command below. I would expect to see 3, 4, not 3, 4, 5, NA

[R] grep question

2009-01-20 Thread Edna Bell
In grep, you can use the options "n" and "o" to get the line number and only the matching text. Is there a way to just get the line number, please? Thanks, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] inconsistent lm results with fixed response variable

2009-01-20 Thread tyler
Rolf Turner writes: > Oh for Pete's sake! No, just for me. > Computers use floating point arithmetic. Your residual standard error in > case 2 (i.e. 1.44e-14) *is* 0, but floating point arithmetic can't quite see > that this is so. Yes, and that's fine. When I put together a lattice plot to

Re: [R] Creating a Sparse Matrix from a Sparse Vector

2009-01-20 Thread Martin Maechler
> "B" == BDGrantham > on Tue, 20 Jan 2009 11:53:55 -0600 writes: B> Hello, B> I am working with a sparse matrix that is approx. 13,900 by 14,100. My B> goal is to select a row out of the matrix and create a new matrix with that B> row repeated 13,900 times without

Re: [R] inconsistent lm results with fixed response variable

2009-01-20 Thread Rolf Turner
Oh for Pete's sake! Computers use floating point arithmetic. Your residual standard error in case 2 (i.e. 1.44e-14) *is* 0, but floating point arithmetic can't quite see that this is so. Put in a check for the RSE being 0, and ``over- ride'' the adjusted R squared to be NA (or NaN, or what

Re: [R] plotting arrows with different colors and varying head size

2009-01-20 Thread Héctor Villalobos
Thanks to Jim and Greg, Concerning the colors of the arrows, color.scale() function from Jim's solution seems more straigthforward to me. I'm trying now to include a proper legend with color.legend() function. Héctor On 20 Jan 2009 at 22:13, Jim Lemon wrote: > Héctor Villalobos wrote: > > De

Re: [R] Dendrogram with the UPGMA method

2009-01-20 Thread Martin Maechler
> "MK" == Marcin Kozak > on Sat, 17 Jan 2009 10:14:10 +0100 writes: MK> Hi, I am clustering objects using the agnes() function MK> and the UPGMA clustering method (function = MK> "average"). Everything works well, but apparently MK> something is wrong with the dendrogr

[R] inconsistent lm results with fixed response variable

2009-01-20 Thread tyler
Hi, I'm analyzing a large number of simulations using lm(), a sample of the resulting data is pasted below. In some simulations, the response variable doesn't vary, ie: > tmp[[2]]$richness [1] 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 When I analyze this using R

Re: [R] Poisson GLM

2009-01-20 Thread David Winsemius
Since one method of modeling rates is to use glm(... ,family="poisson") with the observed rate (events/ person_time) on the LHS of the formula and offset=log(expected_rates) on the RHS, I am quite happy that no error is thrown in that situation. Reading old entries in r-help, it appears the

Re: [R] Summing Select Columns of a Data Frame?

2009-01-20 Thread Jorge Ivan Velez
Hi again Julia, Here are two more options: DF<-read.table(textConnection(" x1 x2 x3 1 2 3 4 5 6 7 8 9"),header=TRUE) closeAllConnections() # Option 1 -- sent before DF$x1+DF$x2 # Option 2 apply(DF,1,function(x) x[1]+x[2]) # Option 3 rowSums(DF[,c(1,2)]) HTH, Jorge On Tue, Jan

Re: [R] How to assign names in a list

2009-01-20 Thread mondher mehdi
Hi for var names other than name1 ,2 and 3 for exple green yellow red use simply names(list2)=c("green","yellow","red") [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Summing Select Columns of a Data Frame?

2009-01-20 Thread Stephan Kolassa
Hi Julia, or you can use colSums on an appropriate sub-data.frame: colSums(dataset[,c(1,2)]) HTH, Stephan Jorge Ivan Velez schrieb: Dear Julia, Try this: DF<-read.table(textConnection(" x1 x2 x3 1 2 3 4 5 6 7 8 9"),header=TRUE) closeAllConnections() DF$x4<-DF$x1+DF$x2 DF HTH,

Re: [R] Can R be installed on a Windows Server for concurrent usage?

2009-01-20 Thread Prof Brian Ripley
Yes. People run classes with (to my knowledge) 40 sessions on a server. On Tue, 20 Jan 2009, Gilbert, Gregory E. wrote: I apologize for this very na??e and stupid question. I have searched the archives and "googled" a number of different queries relating to this question and cannot find the

Re: [R] Summing Select Columns of a Data Frame?

2009-01-20 Thread Jorge Ivan Velez
Dear Julia, Try this: DF<-read.table(textConnection(" x1 x2 x3 1 2 3 4 5 6 7 8 9"),header=TRUE) closeAllConnections() DF$x4<-DF$x1+DF$x2 DF HTH, Jorge On Tue, Jan 20, 2009 at 2:12 PM, Julia Zhou wrote: > Hi, > > I would like to operate on certain columns in a dataframe, but no

[R] Summing Select Columns of a Data Frame?

2009-01-20 Thread Julia Zhou
Hi, I would like to operate on certain columns in a dataframe, but not others. My data looks like this: x1 x2 x3 1 2 3 4 5 6 7 8 9 I want to create a new column named x4 that is the sum of x1 and x2, but NOT x3. I looked at colSums and apply, but those functions seem to use all the c

[R] Can R be installed on a Windows Server for concurrent usage?

2009-01-20 Thread Gilbert, Gregory E.
I apologize for this very naïve and stupid question. I have searched the archives and "googled" a number of different queries relating to this question and cannot find the answer. My Division is moving toward running an application server for all statistical applications because the Departm

[R] Poisson GLM

2009-01-20 Thread bbbnc
This is a basics beginner question. I attempted fitting a a Poisson GLM to data that is non-integer ( I believe Poisson is suitable in this case, because it is modelling counts of infections, but the data collected are all non-negative numbers with 2 decimal places). My question is, since R does

Re: [R] Gentleman and Ihaka's integrity in question

2009-01-20 Thread Rolf Turner
On 20/01/2009, at 5:56 PM, Berwin A Turlach wrote: Mark, don't feed the troll. Well said! cheers, Rolf Cheers, Berwin On Mon, 19 Jan 2009 22:38:24 -0600 (CST) markle...@verizon.net wrote: Hi: I think I saw a link where the author

Re: [R] creating a list of matrices or data frames

2009-01-20 Thread hadley wickham
On Tue, Jan 20, 2009 at 10:34 AM, Simon Pickett wrote: > Hi all, > > How would you create a list of data.frames within a loop, then bind all the > elements of the list using rbind? > > take this example of matrices with differing numbers of rows > > for(i in 1:3){ > assign(paste("s",i, sep=""),mat

[R] Creating a Sparse Matrix from a Sparse Vector

2009-01-20 Thread BDGrantham
Hello, I am working with a sparse matrix that is approx. 13,900 by 14,100. My goal is to select a row out of the matrix and create a new matrix with that row repeated 13,900 times without having to do any looping. Example: Starting Matrix: exampleMatrix 3 x 4 sparse Matrix of class "dgCMatrix

Re: [R] generalizing expand.table: table -> data.frame

2009-01-20 Thread Marc Schwartz
on 01/20/2009 10:38 AM Michael Friendly wrote: > In > http://tolstoy.newcastle.edu.au/R/e2/help/06/10/3064.html > a method was given for converting a frequency table to an expanded data > frame representing each > observation as a set of factors. A slightly modified version was later > included in

Re: [R] plotting points with two colors

2009-01-20 Thread Greg Snow
I don't know how efficient you would consider this, but here is one solution: library(TeachingDemos) ms.2circ <- function(r=1, adj=0, col1='blue', col2='red', npts=180) { tmp1 <- seq( 0, pi, length.out=npts+1) + adj tmp2 <- seq(pi, 2*pi, length.out=npts+1) + adj polygon(

Re: [R] building windows binary of a package

2009-01-20 Thread Duncan Murdoch
On 1/20/2009 12:17 PM, Li, Xiaochun wrote: Hi, I'm trying to build a Windows binary from a source package using R-2.8.1. I downloaded Rtools29 and set up the path. I got this error when running R CMD INSTALL, make: sh.exe: Command not found make: *** [pkg-SurvCov] Error 127 *** Installation o

Re: [R] plotting points with two colors

2009-01-20 Thread David Winsemius
?plot.default plot(x <- rnorm(47), type = "p", main = "plot(x, type = \"p\")", col = c("dark red","blue")) If you plan to have a system for the coloring, you need to get the values sequence-aligned with the colors. This just colors every other point "blue". -- David Winsemius On Jan 20,

Re: [R] creating a list of matrices or data frames

2009-01-20 Thread Henrique Dallazuanna
Try this also: lapply(1:3, matrix, data = NA, ncol = 3, byrow = F, dimnames = NULL) do.call(rbind, lapply(1:3, matrix, data = NA, ncol = 3, byrow = F, dimnames = NULL)) On Tue, Jan 20, 2009 at 2:34 PM, Simon Pickett wrote: > Hi all, > > How would you create a list of data.frames within a loop, t

Re: [R] creating a list of matrices or data frames

2009-01-20 Thread Chuck Cleland
On 1/20/2009 11:34 AM, Simon Pickett wrote: > Hi all, > > How would you create a list of data.frames within a loop, then bind all > the elements of the list using rbind? > > take this example of matrices with differing numbers of rows > > for(i in 1:3){ > assign(paste("s",i, sep=""),matrix(data

[R] plotting points with two colors

2009-01-20 Thread Georg Ehret
Dear Miss R, I am trying to plot a scatterplot in which the points (round) should have two colors: half red and half blue (if you want: two half solid circles put together. Can you please help me to realize this efficiently? Thank you, Best regards, Georg. *

[R] Confidence intervals in ccf()

2009-01-20 Thread Shruthi Jayaram
Hi, I have been running the ccf() function to find cross-correlations of time series across various lags. When I give the option of plot=TRUE, I get a plot that gives me 95% confidence interval cut-offs (based on sample covariances) for my cross-correlations at each lag. This gives me a sense of

[R] building windows binary of a package

2009-01-20 Thread Li, Xiaochun
Hi, I'm trying to build a Windows binary from a source package using R-2.8.1. I downloaded Rtools29 and set up the path. I got this error when running R CMD INSTALL, make: sh.exe: Command not found make: *** [pkg-SurvCov] Error 127 *** Installation of SurvCov failed *** However, I can run 'sh'

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-20 Thread Greg Snow
The best thing to do really depends on your situation and what question you are trying to answer with your plot. Shades of grey has been mentioned, and in some cases that works, but you then run into the problem (same problem with colors and hatching density) of figuring out which bars to mak

[R] generalizing expand.table: table -> data.frame

2009-01-20 Thread Michael Friendly
In http://tolstoy.newcastle.edu.au/R/e2/help/06/10/3064.html a method was given for converting a frequency table to an expanded data frame representing each observation as a set of factors. A slightly modified version was later included in the NCStats package, only on http://rforge.net/ (and i

Re: [R] read a xls file

2009-01-20 Thread Gabor Grothendieck
On Tue, Jan 20, 2009 at 11:21 AM, Ian Jenkinson wrote: > I saw this about RODBC, but it seemed a complicated way of doing things, and > in any case it seems that to run RODBC you need Excel 2004 or higher, which > I would need to buy. > One beautiful thing about R and OOo is that they are excellen

[R] creating a list of matrices or data frames

2009-01-20 Thread Simon Pickett
Hi all, How would you create a list of data.frames within a loop, then bind all the elements of the list using rbind? take this example of matrices with differing numbers of rows for(i in 1:3){ assign(paste("s",i, sep=""),matrix(data = NA, nrow = i, ncol = 3, byrow = FALSE, dimnames = NULL))

Re: [R] Error message from CV.GLM

2009-01-20 Thread Prof Brian Ripley
Who said the variables were all in the data frame? See this All the variables in 'formula', 'subset' and in '...' are looked for first in 'data' and then in the environment of 'formula' (see the help for 'formula()' for further details) and collected into a data frame. Now y

[R] Statistics books

2009-01-20 Thread glenn
Not strictly R sorry Looking for some new books on the topics of; Correlation, and Rank-Reduction in general If anyone has any suggestions I would appreciate it Amazon yielded some books from SAGE publishers which looked ok Regards Glenn [[alternative HTML version deleted]]

Re: [R] read a xls file

2009-01-20 Thread Ian Jenkinson
On 2009-01-20 15:24, Gavin Simpson wrote: On Tue, 2009-01-20 at 14:45 +0100, Ian Jenkinson wrote: See the R Import/Export manual. Also RSiteSearch("import excel") gives many hits. It seems as if this question is asked almost daily. On Sun, Jan 18, 2009 at 9:15 AM, Michele Santacatterina w

Re: [R] Error message from CV.GLM

2009-01-20 Thread Max Kuhn
> I have problems with the usage of cv.glm from the boot package. Here are some > parts of the script I wanted to use: > > data <- read.table("selected_2D.csv", header=TRUE, sep=",") > … > glm.fitted <- glm("ydata$ y ~ 1 + density + vsurf_ID6 + vsurf_S ", data=data) > error <- cv.glm(data=data, g

[R] heatmap.2 color issue

2009-01-20 Thread Liu, Hao [CNTUS]
Dear All: I tried to use heatmap.2 to generate hierarchical clustering using the following command: heatmap.2(datamatrix, scale="row", trace="none", col=greenred(256), labRow=genelist[,1], margins=c(10,10), Rowv=TRUE, Colv=TRUE) datamatrix is subset of a RMA normalized data subset by a genelis

[R] Error message from CV.GLM

2009-01-20 Thread Markus Mühlbacher
Dear list members. I have problems with the usage of cv.glm from the boot package. Here are some parts of the script I wanted to use: data <- read.table("selected_2D.csv", header=TRUE, sep=",") … glm.fitted <- glm("ydata$ y ~ 1 + density + vsurf_ID6 + vsurf_S ", data=data) error <- cv.glm(data

Re: [R] two-sample test of multinomial proportion

2009-01-20 Thread Gustaf Rydevik
On Tue, Jan 20, 2009 at 4:08 PM, Gustaf Rydevik wrote: > Hi all, > > This is perhaps more a statistics question than an R question, but I > hope it's OK anyhow. > > I have some data (see below) with the number of tests positive to > subtype H1 of a virus, the number of tests postive to subtype H3,

Re: [R] regex -> negate a word

2009-01-20 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > > attached are patches to character.c, names.c, and grep.R; if you tell me > forgot to add: the patches are against the latest r-devel (19.01.2009). compiled and tested on 32b Ubuntu 8.04. vQ __ R-help@r-project.org mai

Re: [R] bug in R2WinBUGS

2009-01-20 Thread Uwe Ligges
John Smith wrote: In newest version of R2WinBUGS, the default directory is changed to working.directory, but never changed back once finished bugs call. Now finally fixed, thanks again for the report and sorry for the delay. Best, Uwe [[alternative HTML version deleted]] __

Re: [R] regex -> negate a word

2009-01-20 Thread Wacek Kusnierczyk
Prof Brian Ripley wrote: > On Mon, 19 Jan 2009, Rolf Turner wrote: > >> >> On 19/01/2009, at 10:44 AM, Gabor Grothendieck wrote: >> >>> Well, that's why it was only provided when you insisted. This is >>> not what regexp's are good at. >>> >>> On Sun, Jan 18, 2009 at 4:35 PM, Rau, Roland wrote: >

[R] two-sample test of multinomial proportion

2009-01-20 Thread Gustaf Rydevik
Hi all, This is perhaps more a statistics question than an R question, but I hope it's OK anyhow. I have some data (see below) with the number of tests positive to subtype H1 of a virus, the number of tests postive to subtype H3, and the total number of tests. This is for two different groups, an

Re: [R] from matrix to data.frame

2009-01-20 Thread Antje
Wow, there are a lot of possibilities... thank you all very much!!! I guess, I'll go for "as.data.frame.table", because it's one line and does exactly what I want :-) Ciao, Antje Antje schrieb: Hello, I have a question how to reshape a given matrix to a data frame. # -

Re: [R] from matrix to data.frame

2009-01-20 Thread jim holtman
the reshape package might also help: > require(reshape) > x A B C D E 1 1 6 11 16 21 2 2 7 12 17 22 3 3 8 13 18 23 4 4 9 14 19 24 5 5 10 15 20 25 > melt(t(x)) X1 X2 value 1 A 1 1 2 B 1 6 3 C 111 4 D 116 5 E 121 6 A 2 2 7 B 2 7 8 C 2

Re: [R] from matrix to data.frame

2009-01-20 Thread Marc Schwartz
on 01/20/2009 08:10 AM Antje wrote: > Hello, > > I have a question how to reshape a given matrix to a data frame. > > # -- >> a <- matrix(1:25, nrow=5) >> a > [,1] [,2] [,3] [,4] [,5] > [1,]16 11 16 21 > [2,]27 12 17 22 > [3,]3

Re: [R] from matrix to data.frame

2009-01-20 Thread Carlos J. Gil Bellosta
Hello, The columns in your output dataframe are the following vectors: X1: as.vector( row(a) ) X2: colnames(a)[as.vector( col(a) )] X3: as.vector( a ) Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com On Tue, 2009-01-20 at 15:10 +0100, Antje wrote: > Hello, > > I h

Re: [R] from matrix to data.frame

2009-01-20 Thread jim holtman
?stack > x <- read.table(textConnection(" A B C D E + 1 1 6 11 16 21 + 2 2 7 12 17 22 + 3 3 8 13 18 23 + 4 4 9 14 19 24 + 5 5 10 15 20 25"), header=TRUE) > > x A B C D E 1 1 6 11 16 21 2 2 7 12 17 22 3 3 8 13 18 23 4 4 9 14 19 24 5 5 10 15 20 25 > stack(x) values ind 1 1

Re: [R] WinBUGS with R

2009-01-20 Thread Frank E Harrell Jr
We are having good success using JAGS and the rjags package. We've put some information at http://biostat.mc.vanderbilt.edu/JAGSInstallExample for linux. It's nice to have a native linux executable, thanks to Martyn Plummer. For those unfamiliar with JAGS, it uses the BUGS language, i.e., t

Re: [R] maptools, sunriset, POSIX timezones

2009-01-20 Thread Roger Bivand
Phil Taylor gmail.com> writes: > > Hi ... > > I wonder if anyone can provide some insight into why the first three > examples using the sunriset function (appended below, with results) give > the correct answer, but the fourth generates and error. > > The first two use ISOdatetime with and w

[R] Bayesian Residual Analysis and GOF for Ordinal Regression Models with Latent Variable Formulation

2009-01-20 Thread reezwan you
Hi: I am wondering if someone could please guide me to some package or implementation of Bayesian Residual Analysis and GOF for Ordinal Regression Models with Latent Variable Formulation. I've chekced arm package which uses glm formulation (howeve, I'm looking for Latent Variable/Data Augmentati

Re: [R] read a xls file

2009-01-20 Thread Gavin Simpson
On Tue, 2009-01-20 at 14:45 +0100, Ian Jenkinson wrote: > > See the R Import/Export manual. Also > > RSiteSearch("import excel") > > gives many hits. It seems as if this question is > > asked almost daily. > > > > On Sun, Jan 18, 2009 at 9:15 AM, Michele Santacatterina > > wrote: > > > >> > H

Re: [R] Proportional response and boosting

2009-01-20 Thread Imelda.Somodi
Dear Gerard, Thank you very much for the quick answer. I am a bit uncertain, what you meant by total frequency of type A. I have data on the extent of type A at a location (let's call it freqA), this can be taken for fequency, yes and I have information on the total extent of all the nautral vege

[R] from matrix to data.frame

2009-01-20 Thread Antje
Hello, I have a question how to reshape a given matrix to a data frame. # -- > a <- matrix(1:25, nrow=5) > a [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]

[R] problem with writing data to *.xls file

2009-01-20 Thread venkata kirankumar
Hi all, I read data from *.xls file and i did some caliculations on that data and now i have to create a column in the same .xls file and i have to insert the data in to the consicutive rows related to the previous data i tried it with *write.xls() *but the thing is it deleted all the columns previ

Re: [R] WinBUGS with R

2009-01-20 Thread Uwe Ligges
Uwe Ligges wrote: richard.cot...@hsl.gov.uk wrote: I am having some problems using R with WinBUGS using the R2WinBUGS package. Specifically, when I try to run bugs() I get the following message. Error in FUN(X[[1L]], ...) : .C(..): 'type' must be "real" for this format To give a little

Re: [R] Merging tables

2009-01-20 Thread Carlos J. Gil Bellosta
Hello, Use merge. Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com On Tue, 2009-01-20 at 13:41 +, Dry, Jonathan R wrote: > I am relatively new to R and am trying to do some basic data manipulation. > Basically I have a table (csv - table 1) of data for a set of samples (

Re: [R] Merging tables

2009-01-20 Thread stephen sefick
?merge ?match On Tue, Jan 20, 2009 at 8:41 AM, Dry, Jonathan R wrote: > I am relatively new to R and am trying to do some basic data manipulation. > Basically I have a table (csv - table 1) of data for a set of samples (rows), > and a second table (table 2) of information about a subset of sam

Re: [R] User input in batch mode

2009-01-20 Thread Sebastien Bihorel
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Merging tables

2009-01-20 Thread Dry, Jonathan R
I am relatively new to R and am trying to do some basic data manipulation. Basically I have a table (csv - table 1) of data for a set of samples (rows), and a second table (table 2) of information about a subset of samples of particular interest. I want to pull out the data from table 1 for th

Re: [R] WinBUGS with R

2009-01-20 Thread Uwe Ligges
richard.cot...@hsl.gov.uk wrote: I am having some problems using R with WinBUGS using the R2WinBUGS package. Specifically, when I try to run bugs() I get the following message. Error in FUN(X[[1L]], ...) : .C(..): 'type' must be "real" for this format To give a little more context, my bugs

Re: [R] read a xls file

2009-01-20 Thread Ian Jenkinson
See the R Import/Export manual. Also RSiteSearch("import excel") gives many hits. It seems as if this question is asked almost daily. On Sun, Jan 18, 2009 at 9:15 AM, Michele Santacatterina wrote: > Hello, > > i have a xls file. I will read it in r, what library-command i use for > this?

Re: [R] Stacked barplot with two stacked bars besides each other

2009-01-20 Thread hadley wickham
On Tue, Jan 20, 2009 at 4:28 AM, Daniel Brewer wrote: > Hi, > > I have a particular barplot I would like to generate, but I am having > trouble getting it to work. What I would like is in effect two barplots > with stacked bars merged into one. For example, I have two samples > (yoda1,yoda2) o

Re: [R] candisc

2009-01-20 Thread Michael Friendly
?candisc would have told you that Computational details for the one-way case are described in Cooley & Lohnes (1971), and in the SAS/STAT User's Guide, "The CANDISC procedure: Computational Details," http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/candisc_sect12.htm. -Michael

Re: [R] Do not want to print when using prop.test

2009-01-20 Thread Peter Dalgaard
Jose Iparraguirre D'Elia wrote: > I am using the function prop.test (base package), which returns a > list with class "htest". All I want to do is to assign one of its > values to a variable, but I do not want R to print the results and added > warning message whenever I invoke the function. > How

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-20 Thread hadley wickham
>>I disagree. Grey levels suck; labels are a kludge. It is an issue >>for ``many'' == 2, for which crosshatching works perfectly. >> > > Could you show an example? > > There are several BW examples in example(barplot), and the gray ones look > better on screen than the cross-hatch

[R] Do not want to print when using prop.test

2009-01-20 Thread Jose Iparraguirre D'Elia
I am using the function prop.test (base package), which returns a list with class "htest". All I want to do is to assign one of its values to a variable, but I do not want R to print the results and added warning message whenever I invoke the function. How can I prevent R from printing on using

Re: [R] R and WinBUGS (via R2WinBUGS) error

2009-01-20 Thread Ben Bolker
What you have given us helps a little bit. Lindsay Stirton manchester.ac.uk> writes: > I am having some problems using R with WinBUGS using the R2WinBUGS > package. Specifically, when I try to run bugs() I get the following > message. > [snip] > Error in FUN(X[[1L]], ...) : >.C(..): 'typ

Re: [R] Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

2009-01-20 Thread ONKELINX, Thierry
Have you tried specifying an absolute path in prefix.string instead of a relative one? HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie

Re: [R] Stacked barplot with two stacked bars besides each other

2009-01-20 Thread Daniel Brewer
Thanks Henrique. Unfortunately, that gets us a step closer but it fails to stack the individual bars, so instead of having a total of 10 for each bar you get 7, 8, 9 & 5 (i.e. the largest for each var sample pair). I tried adding the stack=T option, but that stacks all of each sample and you are

Re: [R] Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

2009-01-20 Thread Duncan Murdoch
Matthieu Stigler wrote: Hello I think there is a conflict between setwd() and \SweaveOpts{prefix.string=}. In the same document, those both command get Sweave confuse the files and directories. See: say my .Rnw document is in File1 If one inserts some setwd() for another file: -setwd(File2)

Re: [R] Perl-R bridge

2009-01-20 Thread Neil Shephard
ANJAN PURKAYASTHA wrote: > > Hi, > I'm planning to access R from my perl scripts. > The only noteworthy bridge seems to be > Statistics-R-0.03. > Would anyone like to share their experience with this Perl-R bridge? Irrespectiv

[R] Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

2009-01-20 Thread Matthieu Stigler
Hello I think there is a conflict between setwd() and \SweaveOpts{prefix.string=}. In the same document, those both command get Sweave confuse the files and directories. See: say my .Rnw document is in File1 If one inserts some setwd() for another file: -setwd(File2) then the command \Sweav

  1   2   >