[R] Installation problems: Linux Java and R not working together

2013-11-19 Thread Uwe Bohne
Dear community, I almost tried for 3 days now to install rJava and package FSelector on my Linux machine but couldn't do so. I searched all the forums and tried some tricks ... but unfortunately couldn't find any solution. First of all I did try to install rJava in my rkward wi

Re: [R] Reading in csv data with ff package

2013-11-19 Thread Jan van der Laan
The following seems to work: data = read.csv.ffdf(x=NULL,file="data.csv",nrows=1001,first.rows = 500, next.rows = 1005,sep=",",colClasses = c("integer","factor","logical")) 'character' doesn't work because ff does not support character vectors. Character vector need to be stored as factors.

Re: [R] Installation problems: Linux Java and R not working together

2013-11-19 Thread Prof Brian Ripley
First, read the posting guide. This is a question about compiled code and belongs on R-devel. Second, the answer will be in the config.log file for rJava which you have not shown us. You need to download and unpack it, then run R CMD INSTALL rJava and look at rJava/config.log If that is n

[R] metafor escalc(measure="SMCC")

2013-11-19 Thread petretta
Dear all, I use R 3.0 for Windows. I ask how escalc(measure="SMCC") [metafor package] mathematically calculate yi and vi when only change score and SD change score are provided. I used the example (repoted below) posted by Qiang Yue at: http://r.789695.n4.nabble.com/using-metafor-for-meta

[R] Overlay boxplot and scatter.smooth line

2013-11-19 Thread Johannes Radinger
Hi, I'd like to plot a boxplot and use a scatter.smooth line plot as an overlay for this plot. This works except for the problem that the x-axis ticks for both plots are differently spaced: The boxplot ticks are closer and the space between the outer most boxplots and the plot region (box) is larg

Re: [R] metafor escalc(measure="SMCC")

2013-11-19 Thread Viechtbauer Wolfgang (STAT)
Dear Mario, You can always just inspect the code: escalc.default Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Psychology School for Mental Health and Neuroscience Faculty of Health, Medicine, and Life Sciences Maastricht University, P.O

[R] image plot with color scale

2013-11-19 Thread Witold E Wolski
I am plotting an image of correlations but need to add a color scale... dat<-matrix(rnorm(1000),ncol=5) labels=c("a","b","c","d","e") cortmp <- cor(dat) image(cortmp , axes = F ) axis( 1, at=seq(0,1,length=length(labels)) , labels=labels , cex.axis=0.8 ,srt = 45,las=2,cex=1) axis( 2, at=seq(0,1,l

Re: [R] image plot with color scale

2013-11-19 Thread Jim Lemon
On 11/19/2013 10:07 PM, Witold E Wolski wrote: I am plotting an image of correlations but need to add a color scale... dat<-matrix(rnorm(1000),ncol=5) labels=c("a","b","c","d","e") cortmp<- cor(dat) image(cortmp , axes = F ) axis( 1, at=seq(0,1,length=length(labels)) , labels=labels , cex.axis=

Re: [R] How to convert a 3 dimensional List to make a table with tables tabular()?

2013-11-19 Thread Duncan Murdoch
On 13-11-18 3:46 PM, Beckstrand, Janis, NCOD wrote: I have information in a 3 dimensional list that I want to use to create a table for a written report. The 3d list was created by applying the epiR function " epitest " to a list of 8 2x2 tables using lapply. The resulting list gives the 12

Re: [R] equal horizontal and vertical proportions in graphics

2013-11-19 Thread Jim Lemon
On 11/19/2013 01:03 PM, Mercutio Florid wrote: I use several different versions of R, including RGui on Windows and rstudio on Linux. In all cases, I use graphical commands, such as image(). image() displays rectangles, but I want to be able to guarantee that the heights of those rectangles w

Re: [R] equal horizontal and vertical proportions in graphics

2013-11-19 Thread Carl Witthoft
see ?par . Use the argument asp=TRUE. Mercutio Florid wrote > I use several different versions of R, including RGui on Windows and > rstudio on Linux.  In all cases, I use graphical commands, such as > image().  > > image() displays rectangles, but I want to be able to guarantee that the >

Re: [R] What is the difference between Mean Decrease Accuracy produced by importance(foo) vs foo$importance in a Random Forest Model?

2013-11-19 Thread Liaw, Andy
The difference is importance(..., scale=TRUE). See the help page for detail. If you extract the $importance component from a randomForest object, you do not get the scaling. Best, Andy -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Beha

Re: [R] Computational differences in R vs Excel

2013-11-19 Thread Carl Witthoft
There are several problems here. The first is that it's rather unlikely you really need 10-place accuracy to fit your data. This suggests you may be doing something inappropriate such as fitting the wrong function or trying to extrapolate. Since you haven't explained what "process" you have th

[R] can par()$pin be used to guarantee equal horizontal and vertical image lengths?

2013-11-19 Thread Mercutio Florid
Today at 10:03 AM I use several different versions of R, including RGui on Windows and rstudio on Linux.  In all cases, I use graphical commands, such as image().  image() displays rectangles, but I want to be able to guarantee that the heights of those rectangles will always equal the w

[R] Repeated measures with categorical data

2013-11-19 Thread sualme
Hello, I am working in a longitudinal study, with a categorical variable as a dependent variable (alcohol consumption: no use, use, abuse and dependence) with repeated measures (baseline, 1 year, 2 years). Besides I have another variable with two groups: control and experimental. I would like to

Re: [R] Providing a Title for a Write.Table - Thinking of Titles in SPSS CTABLES

2013-11-19 Thread Adams, Jean
One way to do it, is just to insert another write.table() command giving the text you want to write. Here's a simple example: myfile <- "c:/temp/junk.csv" for(i in 1:5) { df <- data.frame(x=rnorm(3), y=rnorm(3)) write.table(paste0("Run #", i), myfile, sep="\t", append=(i!=1), col.names=FALSE, row

Re: [R] Overlay boxplot and scatter.smooth line

2013-11-19 Thread Adams, Jean
Use lines() with loess.smooth() instead of scatter.smooth() to add to the already existing boxplot. For example, boxplot(y~x) lines(loess.smooth(x, y)) Jean On Tue, Nov 19, 2013 at 4:43 AM, Johannes Radinger < johannesradin...@gmail.com> wrote: > Hi, > > I'd like to plot a boxplot and use a s

Re: [R] Repeated measures with categorical data

2013-11-19 Thread Ben Bolker
sualme osakidetza.net> writes: > > Hello, > I am working in a longitudinal study, with a categorical variable as a > dependent variable (alcohol consumption: no use, use, abuse and dependence) > with repeated measures (baseline, 1 year, 2 years). Besides I have another > variable with two groups

Re: [R] Computational differences in R vs Excel

2013-11-19 Thread S Ellison
> > For example, i am performing this simple arithmetic: > > 23-(1.346493052*16)+(.663965156*11)+(.008569426*5)-15.23480728 > > > > R gives the result --> -6.432232271 My machine (win32, R 3.0.1) gives -6.432232266 Something about your machine, or typing, is different. It shouldn't be R, a

Re: [R] Warning message during starts up

2013-11-19 Thread S Ellison
> During startup R gives a Warning message: "Setting LC_CTYPE=en_US > gnumeric & failed" What is the error and how can I fix it? Googling the error message provides a number of answers from various sites; perhaps you could try that? It seems silly to retype them here Incidentally, the answers I s

Re: [R] Overlay boxplot and scatter.smooth line

2013-11-19 Thread Johannes Radinger
Thanks...that works great! /J On Tue, Nov 19, 2013 at 2:39 PM, Adams, Jean wrote: > Use lines() with loess.smooth() instead of scatter.smooth() to add to the > already existing boxplot. For example, > > boxplot(y~x) > lines(loess.smooth(x, y)) > > Jean > > > On Tue, Nov 19, 2013 at 4:43 AM, J

Re: [R] How to extract sets of rows (not sorted) from text file in R, do some methods on these rows, save the result in another text file, then pick others set of rows and do the same

2013-11-19 Thread arun
Hi, You may need ?split(), or ?aggregate() or ?ddply() from library(plyr) dat1 <- read.table(tex="1 2 4 7 8 9 1 4 5 8 9 1 4 5 6 9 2 3 4 8 3 6 7 8 1 5 6 9 2 5 7 9",header=FALSE,sep="",fill=TRUE)  ##  res1 <- do.call(rbind,lapply(split(dat1,dat1[,1]),function(x) c(V1=x[1,1],colSums(x[,-1],na.rm=

[R] XLConnect error - "not implemented yet"

2013-11-19 Thread Barry King
When using XLConnect's readWorksheet, instead of it correctly reading string and numeric columns, I receive NA's with the following message: " Error when trying to evaluate cell A2 - not implemented yet" I do not know what this means. Can anyone please assist? -- __ *Ba

Re: [R] XLConnect error - "not implemented yet"

2013-11-19 Thread Rui Barradas
Hello, I believe this is the sort of error message you should ask the maintainer about. maintainer('XLConnect') [1] "Martin Studer " Hope this helps, Rui Barradas Em 19-11-2013 15:49, Barry King escreveu: When using XLConnect's readWorksheet, instead of it correctly reading string and nume

Re: [R] 3D Plot of Convex hull

2013-11-19 Thread David Winsemius
On Nov 18, 2013, at 8:01 PM, wwreith wrote: > I have a data set in which I am trying to plot a convex hull in 3 dim. Below > is a subset of the points I would use. Columns 2,3,4 are my x,y,z > coordinates. I found some ways to plot 2D convext hulls or find a convex > hull for higher dimensions, b

Re: [R] Rotation of parallel lines

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 5:53 AM, Tonio wrote: > Thank you for your post. I believe that it is possible to make a function to > rotate a graphical component that might be based on the rotation matrix. > > > I'll take a look to the packages anyway... It's certainly possible to "rotate" abstract s

Re: [R] Computational differences in R vs Excel

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 6:02 AM, S Ellison wrote: >>> For example, i am performing this simple arithmetic: >>>23-(1.346493052*16)+(.663965156*11)+(.008569426*5)-15.23480728 >>> >>> R gives the result --> -6.432232271 > > > My machine (win32, R 3.0.1) gives -6.432232266 > > Something about you

Re: [R] Overlay boxplot and scatter.smooth line

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 2:43 AM, Johannes Radinger wrote: > Hi, > > I'd like to plot a boxplot and use a scatter.smooth line plot as an overlay > for this plot. > This works except for the problem that the x-axis ticks for both plots are > differently spaced: > The boxplot ticks are closer and the s

[R] Inverse of Probit

2013-11-19 Thread Calum
Hi there, I hope someone can help me. I have a dataset of Concentration against Mortality, and I am trying to compare the use of Logit and Probit models using this data. The issue I am having is trying to back transform the data from the probit model, to plot it in normal space instead of log spa

Re: [R] Inverse of Probit

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 10:59 AM, Calum wrote: > Hi there, > I hope someone can help me. > > I have a dataset of Concentration against Mortality, and I am trying to > compare the use of Logit and Probit models using this data. > > The issue I am having is trying to back transform the data from the

Re: [R] Optim function & Hessian matrix

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 12:09 PM, sofeira taajobian wrote: > Dear R Users > Hi, > > > I have very emergency problems in my programming about finding MLE > with optim command. I reproduced it with real data. I guess that my > function object in optim is very sensitive because it has power > func

Re: [R] Hide return values

2013-11-19 Thread Brian Diggs
On 11/17/2013 5:28 AM, David Winsemius wrote: On Nov 17, 2013, at 3:21 AM, Chris89 wrote: Hi everyone! I am in the process of writing an R-package and while writing a summary function, I have come across a problem. I am able to print a summary table (as in a standard glm() summary) by using *

[R] Does function read.sas7bdat() have some memory limitations?

2013-11-19 Thread Li, Xiaochun
Dear R-ers, I was trying to read in a large sas7bdat file (size 148094976 bytes) using 'read.sas7bdat()', but it did not read in the data correctly. E.g., the first 5 rows will come out like this (I'm omitting other columns to keep it readable): PERSON_ID age 1 5.399114e-315

[R] Help with removing extra legend elements in ggplot

2013-11-19 Thread Matthew Van Scoyoc
I can't get the fine tuning right with my legend. I get an extra legend element "10" which is the point size in my plot. Can someone help me get rid of this extra element? Additionally I would also like to reduce the size of the legend. If you want to reproduce my figure you can download my data

Re: [R] Help with removing extra legend elements in ggplot

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 3:44 PM, Matthew Van Scoyoc wrote: > I can't get the fine tuning right with my legend. I get an extra legend > element "10" which is the point size in my plot. Can someone help me get rid > of this extra element? Additionally I would also like to reduce the size of > the legen

[R] (no subject)

2013-11-19 Thread Jim Silverton
I generated some random data using R and then trying to see if it came from the same distribution but the erros keep piling. Can anyone help? y=rchisq(10,1) mean(y) var(y) library(MASS) fitdistr(y, "chi-squared", start = list(4), method = "Brent", lower=0.9, upper=3) -- Thanks, Jim.

Re: [R] Help with removing extra legend elements in ggplot

2013-11-19 Thread Matthew Van Scoyoc
No dice. I still get the "10" legend element. Thanks for the quick reply. Cheers, MVS = Matthew Van Scoyoc Graduate Research Assistant, Ecology Wildland Resources Department & Ecology Center Quinney College of Natural Resources

Re: [R] Help with removing extra legend elements in ggplot

2013-11-19 Thread Dennis Murphy
The additional element comes from this code: geom_point(aes(color = VegType, shape = VegType, size = 10)) Take the size argument outside the aes() statement and the legend will disappear: geom_point(aes(color = VegType, shape = VegType), size = 10) The aes() statement maps a variable to a plot

Re: [R] Help with removing extra legend elements in ggplot

2013-11-19 Thread Matthew Van Scoyoc
Awesome! Thanks for the fix Dennis, and thanks for clearing up aes() too. It makes sense now. Cheers, MVS = Matthew Van Scoyoc Graduate Research Assistant, Ecology Wildland Resources Department & Ecology Center Quinney College of Nat

Re: [R] (no subject)

2013-11-19 Thread Pascal Oettli
Hello, The value for 'start' is not correct. According to the help for "fitdistr", 'start' should contain the paramaters used by the random function (?rchisq) Hope this helps, Pascal On 20 November 2013 09:29, Jim Silverton wrote: > I generated some random data using R and then trying to see if

[R] if else in R

2013-11-19 Thread Gary Dong
Dear R users, I am a R beginner and I am having trouble in using "If Else" in R. Here is an example: ## create a data frame a<-c(1,2,3,4) b<-c(2,0,5,0) ab<-data.frame(cbind(a,b)) ##calculate c, which is the ratio between a and b if(ab$b>0) { ab$c<-ab$a/ab$b } else { ab$c<-0 } here is the e

Re: [R] if else in R

2013-11-19 Thread Nick Matzke
Hi, This would be an issue with if() as well as if/else. ab$b has 4 numbers in it, so ab$b > 0 evaluates to "TRUE TRUE FALSE TRUE" or whatever. if() can only take a single true or false. Cheers! Nick On Tue, Nov 19, 2013 at 8:30 PM, Gary Dong wrote: > Dear R users, > > I am a R beginner and I a

Re: [R] if else in R

2013-11-19 Thread Ben Tupper
Hi, On Nov 19, 2013, at 9:41 PM, Nick Matzke wrote: > Hi, > > This would be an issue with if() as well as if/else. ab$b has 4 > numbers in it, so ab$b > 0 evaluates to "TRUE TRUE FALSE TRUE" or > whatever. if() can only take a single true or false. Cheers! Nick > As a follow up, you could ma

Re: [R] if else in R

2013-11-19 Thread arun
Hi, Try: within(ab, {c <- ifelse(b>0, a/b,0)}) A.K. On Tuesday, November 19, 2013 8:51 PM, Gary Dong wrote: Dear R users, I am a R beginner and I am having trouble in using "If Else" in R. Here is an example: ## create a data frame a<-c(1,2,3,4) b<-c(2,0,5,0) ab<-data.frame(cbind(a,b)) ##c

Re: [R] if else in R

2013-11-19 Thread Jeff Newmiller
Which means you should use the ifelse function... ab$c <- ifelse( ab$b>0, ab$a/ab$b, 0 ) --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] If commands in a while loop

2013-11-19 Thread Hlebtomane
Unfortunately, the while loop in the following code doesn't seem to work. It would be very nice if someone might help me, thanks in advance: z = 0*c(1:1000) while (sum(z) < 751){ for(mu in (900:1100)/1){ for(i in(1:1000)) { z[i] <- V5[i]*exp(5*mu) if (z[i] >= 1

[R] R- package for Parametric Survival Analysis with Left-censored data

2013-11-19 Thread Vinod Mishra
Dear All, I am new to R. Can someone please direct me to an R package using which I can estimate a Parametric Survival Analysis model with Left-censored (delayed entry) data in it. I recently received reviewers comment on my submitted article, where the reviewer suggested that only R has capa

Re: [R] if else in R

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 5:30 PM, Gary Dong wrote: > Dear R users, > > I am a R beginner and I am having trouble in using "If Else" in R. Here is > an example: > > ## create a data frame > > a<-c(1,2,3,4) > b<-c(2,0,5,0) > ab<-data.frame(cbind(a,b)) > > ##calculate c, which is the ratio between a

Re: [R] If commands in a while loop

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 5:22 PM, Hlebtomane wrote: > Unfortunately, the while loop in the following code doesn't seem to work. It > would be very nice > if someone might help me, thanks in advance: > > z = 0*c(1:1000) I think it is more likely that you don't know what z looks like. Try `head(z)`

Re: [R] R- package for Parametric Survival Analysis with Left-censored data

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 5:30 PM, Vinod Mishra wrote: > Dear All, > > I am new to R. Can someone please direct me to an R package using which I can > estimate a Parametric Survival Analysis model with Left-censored (delayed > entry) data in it. > > I recently received reviewers comment on my subm

Re: [R] Datatable manipulation

2013-11-19 Thread arun
Hi, Try: dat1 <- read.table(text="a b c x 1 4 7 y 2 5 8 z 3 6 9",header=TRUE) dat2 <- dat1 #either library(reshape2) res1 <- within(melt(dat1,id.var="ID"),cell<-as.character(interaction(variable,ID,sep="_")))[,c(4,3)] #or indx <- which(dat2>0,arr.ind=TRUE) res2 <- data.frame(cell=paste(colnames

Re: [R] Optim function & Hessian matrix

2013-11-19 Thread David Winsemius
This is the code that was attached. I arrived in the copy sent to my email address: #-- L1=function(X){ B1=X[1] C1=X[2] B2=X[3] C2=X[4] mu=X[5] S=-(B1*(C1^x)*((C1^v)-1)/log(C1)) +(d2*log(B1*(C1^(x+v -(B2*(C2^y)*((C2^v)-1)/log(C2)) +(d1*log(B2*(C2^(y+v -(v*mu) +

Re: [R] R- package for Parametric Survival Analysis with Left-censored data

2013-11-19 Thread peter dalgaard
On 20 Nov 2013, at 04:15 , David Winsemius wrote: > > On Nov 19, 2013, at 5:30 PM, Vinod Mishra wrote: > >> Dear All, >> >> I am new to R. Can someone please direct me to an R package using which I >> can estimate a Parametric Survival Analysis model with Left-censored >> (delayed entry) da

[R] save table to txt file in a printable form

2013-11-19 Thread Alaios
Hi there, I would like to save tabular (in R just matrices) in a txt file but in a way that they would be somehow readable. That means keeping columns aligned and rows so one can read easily for example the 2,3 element. IS there a way to do that in R? capture.output for example does not produce

Re: [R] save table to txt file in a printable form

2013-11-19 Thread Enrico Schumann
On Wed, 20 Nov 2013, Alaios writes: > Hi there, > I would like to save tabular (in R just matrices) in a txt file but in a way > that they would be somehow readable. > That means keeping columns aligned and rows so one can read easily for > example the 2,3 element. > > IS there a way to do that