Re: [R] rJava is not loading

2013-06-05 Thread Prof Brian Ripley
On 06/06/2013 00:38, Dimitri Liakhovitski wrote: Hello! I installed rJava and am trying to load it. library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Ja

[R] multivariate multilevel model

2013-06-05 Thread Patty Haaem
Hi I want to fit a multivariate multilevel model for a longitudinal data set. can you introduce me a package or some function to fit this model? Thanks in advance. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https:/

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Bert Gunter
Thanks, Bill. Clearly something I missed. I appreciate your filling in that crack. Another equivalent way to do it? f2 <- function(c,nm = "gamma",...) { probFunc <- paste0(c,nm) more <- list(...) function(x)do.call(probFunc,c(x,more)) } This avoids the explicit use of get() and force(), I

Re: [R] dates and time series management

2013-06-05 Thread arun
Hi, I think it is due to the missing values: I get warnings()  z.5.annualMax<- daily2annual(z, FUN=max, na.rm=TRUE,dates=1) #There were 50 or more warnings (use warnings() to see the first 50) write.csv(z.5max.annual, file = "Stations.csv") Just to validate  the result: I tried this: res3<- lap

[R] lme function cannot find object

2013-06-05 Thread Pfeiffer, Steven
Hello, I have been using the function lme() from package 'nlme' for several months now without any problems. Suddenly, it cannot find a factor in my data. Is this a new bug of some kind? My code and output are below. Thanks for your help! -Steve Pfeiffer require(xlsx) require(nlme) Dat.middle<-

Re: [R] SPlus script

2013-06-05 Thread Duncan Mackay
Hi Scott I converted the _ to <- and ran it in 3.01 Ran about half way and then could not find nl? and others so may be some scoping problems? or other problems Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@north

Re: [R] Map Antarctica

2013-06-05 Thread Pascal Oettli
Hi, There is a problem with xlim and ylim. map("worldHires","Antarctica",xlim=c(-180,180),ylim=c(-90,-60),col="gray90",fill=TRUE) You also might have a look at "ggplot2" library(ggplot2) world <- map_data("world") worldmap <- ggplot(world, aes(x=long, y=lat, group=group)) + geom_path() +

Re: [R] Map Antarctica

2013-06-05 Thread Michael Sumner
You have mixed your x with your y, try this: map("worldHires","Antarctica",ylim=c(-90,-60),xlim=c(-180,180),col="gray90",fill=TRUE) I tend not to use maps/mapdata if I can help it (there are problems as you can see, though there is support for projections with mapproject, see ?map), if you want

Re: [R] Subsetting out missing values for a certain variable

2013-06-05 Thread Jorge I Velez
Daniel, You need "==" instead of "=". HTH, Jorge.- Sent from my phone. Please excuse my brevity and misspelling. On Jun 6, 2013, at 10:36 AM, Daniel Tucker wrote: > Also tried this but results werent any different > > subset1<- subset(dframe, glb_ind="Y" | sample==1 | !is.na(glb_ind)) > subset2

[R] combining two different matrizes

2013-06-05 Thread ThomasH
Hello together, this is ma first post, so please aplogize me if post this in the wrong section. I have problem concerning ma two matrizes. After a regressione and so on, I got two matrizes Matrixres contains the results of ma calculation. Matrixr contains my detiene, which where Aldo used for

[R] Error in anova.cca by="axis" after Vegan update

2013-06-05 Thread Edwards, Danielle
Hi, I am trying to replicate some code I previously used to undertake a dbRDA analysis, however since updating my R software and all associated packages to the latest version it seems the analysis does not work. I have two dist objects: gendist and geodist. I first reduce geodist using pcnm().

[R] Temporally autocorrelated Poisson data

2013-06-05 Thread Ali Swanson
Hi - Is there a way to simultaneously control for temporal autocorrelation and Poisson-distributed data in R? I have seen similarly threaded topics as recently as 2009, but the statistical texts suggested in them are well above my comprehension, and I'm hopeful that more straightforward solutions

Re: [R] installing package 'rqpd' (Regression quantiles for panel data)

2013-06-05 Thread Manish K. Srivastava
Dear Henric, Thank you so much. I was able to successfully install the "rqpd" package on my Windows machine (win 7) using the R.2.15.1 version. I greatly appreciate your wonderful help. Thank you. Best regards, Manish On 6/4/2013 3:54 PM, Henric Winell wrote: > Manish, > > Manish K. Srivasta

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread ivo welch
I just tested read.csv with files...it still works. it can read one line at a time (without col.names and with nrows). nice. it loses its type memory across reinvokcations, but this is usually not a problem if one reads a few thousand lines inside a buffer function. this sort of function is use

Re: [R] Subsetting out missing values for a certain variable

2013-06-05 Thread Daniel Tucker
Also tried this but results werent any different subset1<- subset(dframe, glb_ind="Y" | sample==1 | !is.na(glb_ind)) subset2<-subset(dframe, cwar_ind="Y" |sample==2 | !is.na(cwar_ind)) subset3<-subset(dframe, reg_ind="Y" | sample==3 | !is.na(reg_ind)) On Wed, Jun 5, 2013 at 9:33 AM, Daniel Tucke

[R] reshape2 issue

2013-06-05 Thread Bruce Miller
Hi all, I am revisiting using reshape2 to aggregate critter (bats) occurrences by time blocks and have the final output for each row sum a percentage such that the row sums total 1 (100%). Reshape2 library is loaded on start. The old code I had stored in NotePad++ seems to no longer work as I

Re: [R] Subsetting out missing values for a certain variable

2013-06-05 Thread Daniel Tucker
The problem might be that "NAs" in the dataset are blank On Wed, Jun 5, 2013 at 9:54 AM, Daniel Tucker wrote: > Also tried this but results werent any different > > subset1<- subset(dframe, glb_ind="Y" | sample==1 | !is.na(glb_ind)) > subset2<-subset(dframe, cwar_ind="Y" |sample==2 | !is.na(cwar

[R] Subsetting out missing values for a certain variable

2013-06-05 Thread Daniel Tucker
I am trying to create a new datafarme using the subset function given 2 conditions subset1<- subset(dframe, glb_ind="Y" | sample==1) subset2<-subset(dframe, cwar_ind="Y" | sample==2) subset3<-subset(dframe, reg_ind="Y" | sample==3) However, my first conditions (glb_ind,cwar_ind, and reg_ind) all

[R] R error- "more columns than column names"

2013-06-05 Thread Sandro Magalhães
I put header=TRUE and sep = “;” and my problem was resolved. read.csv("./scoreDb.csv",header = TRUE,sep=";" Best Regards, Sandro [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

[R] sandwich matrix in gamm

2013-06-05 Thread Isabel Proença
Hello, I need to calculate a sandwich covariance matrix in gamm. The package sandwich does not work because: Error in UseMethod("vcov") : no applicable method for 'vcov' applied to an object of class "c('gamm', 'list')" Does anyone knows how to overcome this problem? Thanks in advance. Regards,

[R] Map Antarctica

2013-06-05 Thread ejb
Hey, I'm new with R and I'm attempting to map and then plot points on a map of Antarctica with help from some code at the following link. Link After downloading the packages here is the code I used. I feel like the problem has to d

[R] List into table

2013-06-05 Thread Andtrei89
Hi everyone, I want to open an XML file in R and it also works. But then I get a list of all numbers but it isn't in the type of "numeric". I tried this: exampleData <- "C:/Users/Andreas/Desktop/Thesis/Interzeptionsmodell/Daten/Karlsruhe/Windgeschwindigkeit/1948.xml" F <- system.file("exampleDa

[R] rJava is not loading

2013-06-05 Thread Dimitri Liakhovitski
Hello! I installed rJava and am trying to load it. library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectur

Re: [R] dates and time series management

2013-06-05 Thread arun
Hi, Try this: lstf1<- list.files(pattern=".txt") length(lstf1) #[1] 119 #I changed the function a little bit to unlist by rows to match the dates column I created. fun2<- function(lstf){  lst1<-lapply(lstf,function(x) readLines(x))  lst2<-lapply(lst1,function(x) {gsub("(\\d+)(-.99)","\\1 \\2"

[R] multilevel binary and ordered regression models

2013-06-05 Thread Xu Jun
Dear r-helpers, I have two questions on multilevel binary and ordered regression models, respectively: 1. Is there any r function (like lmer or glmer) to run multilevel ordered regression models? 2. I used the glmer function to run a two-level binary logit model. I want to make sure that I did i

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread William Dunlap
You can put print statements into the arguments given to a function to more directly see when they get evaluated. E.g., > z <- f0(c={ cat("Evaluating 'c' argument\n"); "p"}, nm="norm", mean={ > cat("Evaluating 'mean' argument\n"); 1.2 }) Evaluating 'c' argument > z(1:5) Evaluating 'mean' argum

Re: [R] probability weights in multilevel models

2013-06-05 Thread Thomas Lumley
Not that I know of. I have ideas, but haven't had time. -thomas On Wed, Jun 5, 2013 at 4:13 AM, j.lenkeit wrote: > Hello, > I am new in R and would be glad for any help. > > My question is: Is there any available package to run a multilevel model > (random/fixed effects) with probability w

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Julio Sergio
William Dunlap tibco.com> writes: > f1 <- function (c, nm = "gamma", ...) > { > probFunc <- getFunction(paste0(c, nm)) > force(list(...)) > function(x) probFunc(x, ...) > } > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > Thanks a lot William!, this really enhances m

Re: [R] SPlus script

2013-06-05 Thread Scott Raynaud
As you can see, my original modification was to replace all _ with <-.  It worked after I did that.  This is a simulation that generates its own data based on the given parameters.  I should obtain a plot of the number of experimental subjects as a function of the repsonse rate in the historic

Re: [R] Lattice, ggplot, and pointsize

2013-06-05 Thread Milan Bouchet-Valat
Le mercredi 05 juin 2013 à 19:37 +0530, Deepayan Sarkar a écrit : > On Sun, May 26, 2013 at 12:47 AM, Milan Bouchet-Valat > wrote: > > Le mardi 21 mai 2013 à 21:39 +0100, Prof Brian Ripley a écrit : > >> On 21/05/2013 21:24, Bert Gunter wrote: > >> > At the risk of misunderstanding... (inline) >

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread William Dunlap
You will want to force the evaluation of the ... arguments, just as you are already forcing the evaluation of 'c', before returning your function. E.g., compare the following two: # your 'faux', renamed and enhanced a bit f0 <- function (c, nm = "gamma", ...) { probFunc <- getFunction(paste

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Julio Sergio
Bert Gunter gene.com> writes: > > faux <- function(c, nm = "gamma",...){ > f <- get(paste0(c,nm)) > function(x)f(x,...) > } > > This could be called with: > > > xgam <- lapply(c("p","d"), faux, shape=k, scale=theta) > > xgam[[1]](1000) > [1] 0.8710477 > > xgam[[2]](1000) > [1] 0

Re: [R] How to display multiples lines with different color on the same plot?

2013-06-05 Thread John Kane
Try: library(ggplot2) ggplot(mtcars, aes(mpg, qsec, colour = as.factor(gear))) + geom_point() + geom_smooth(method = lm, se = FALSE) You probably will have to melt your data to get into the right format. John Kane Kingston ON Canada > -Original Message- > From: armel.kap...@sdstate.ed

Re: [R] reshape2 issue solved Tnx!

2013-06-05 Thread John Kane
Yes , I think it was only a year or two ago that the change occured. John Kane Kingston ON Canada > -Original Message- > From: neotropical.b...@gmail.com > Sent: Wed, 05 Jun 2013 15:26:25 -0400 > To: r-help@r-project.org > Subject: [R] reshape2 issue solved Tnx! > > Hi again all, > > A

[R] reshape2 issue solved Tnx!

2013-06-05 Thread Neotropical bat risk assessments
Hi again all, As the original code lines I had dated back to 2007 that may have predated reshape2? In any case the use of *dcast *rather than /*cast*/ solved the issue. Then with 3 steps: Stop read Think I saw I just needed to change the line input.cast <- cast(input.melt, Species ~ *Date*, fu

Re: [R] SPlus script

2013-06-05 Thread William Dunlap
Both the R and S+ versions (which seem to differ only in the use of _ for assignment in the S+ version) do nothing but define some functions. You would not expect any printed output unless you used those functions on some data. Is there another script that does that? Bill Dunlap Spotfire, TIB

Re: [R] SPlus script

2013-06-05 Thread peter dalgaard
On Jun 5, 2013, at 20:58 , Scott Raynaud wrote: > See my comments below. > > From: Pascal Oettli > To: Scott Raynaud > Sent: Wednesday, June 5, 2013 10:02 AM > Subject: Re: [R] SPlus script > > > > Hello, > > 1) It is always nice to say something as "Hello"

Re: [R] reshape2 issue continued

2013-06-05 Thread John Kane
Interestingly enoughhelp(cast) did not work but ?cast does As Ista says, there is no cast() in reshape2 John Kane Kingston ON Canada > -Original Message- > From: tea...@gmail.com > Sent: Wed, 5 Jun 2013 11:55:43 -0400 > To: neotropical.b...@gmail.com > Subject: Re: [R] reshape2 issue c

Re: [R] SPlus script

2013-06-05 Thread Scott Raynaud
See my comments below. From: Pascal Oettli To: Scott Raynaud Sent: Wednesday, June 5, 2013 10:02 AM Subject: Re: [R] SPlus script Hello, 1) It is always nice to say something as "Hello", Tried, but could make it come out in anything other than four letters.

Re: [R] sample {base}

2013-06-05 Thread arun
Hi, Try:  fun1<- function(dat,Col1,Col2,number){  lst1<- split(dat,list(dat[,Col1],dat[,Col2]))  lst2<- lst1[lapply(lst1,nrow)>0]  res<- lapply(lst2,function(x) sample(x[,1],if(nrow(x)< number) nrow(x) else number,replace=FALSE))  res} head(fun1(Gpool,"LngtClas","SpCode",5),4) #$`40_49.MERLMER` #[

Re: [R] plyr _aply simplifying return-value dimensions

2013-06-05 Thread Adams, Jean
Will using the function mlply() rather than maply() do the trick for you? For example dat <- data.frame(dim1=1:10, dim2=1:10) foo <- maply(dat, function(dim1, dim2) list(a="foo", b=runif(10))) foo2 <- mlply(dat, function(dim1, dim2) list(a="foo", b=runif(10))) Jean On Wed, Jun 5, 2013 at 12:33

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Bert Gunter
Rui et al. Certainly correct. However, I think the use of force() and similar should be avoided if possible, as computing on the language can be tricky. So here is an alternative formulation that avoids it: faux <- function(c){ f <- get(paste0(c,"gamma")) ## evaluation of c is forced here fu

Re: [R] reshape2 issue continued

2013-06-05 Thread Ista Zahn
There is indeed a ?cast help topic in reshape2, but there is no cast function. Instead there is dcast (returns a data.frame) and acast(returns an array). Bruce, you can try your original example with input.cast <- dcast(input.melt, Species ~ Date, fun.aggregate = sum) Best, Ista On Wed, Jun 5,

Re: [R] reshape2 issue continued

2013-06-05 Thread Thomas Adams
Bruce, I'm not sure what's going on since I tried this on my Linux system running R 3.0.0 and just did: library(reshape2) help(cast) and the help for 'cast' came up. There was no indication to me that 'reshape' was needed and I can not see a dependency in CRAN for 'reshape'. But I built R from s

Re: [R] split and common variables

2013-06-05 Thread David Carlson
Your request is still vague. Arun has given you one approach. This will tell you which names are found in pairs of places: > ndf <- length(names(dta.df.sp)) > results <- vector("list") > for (i in 1:(ndf-1)) { + for (j in (i+1):ndf) { + pair <- paste(names(dta.df.sp)[i], names(dta.df.sp)[j]) + res

Re: [R] dates and time series management

2013-06-05 Thread arun
Hi Atem, No problem.  which(res==-.99) # [1]   18246  397379  420059  426569  427109  603659  604199  662518  664678 #[10]  698982  699522  700062  701142  754745 1289823 1500490 1589487 1716011 #[19] 1837083  which(res==-.99,arr.ind=TRUE) #    row col #1506   1506   2 #12359 12359  2

[R] reshape2 issue continued

2013-06-05 Thread Neotropical bat risk assessments
Hi again all, Several replied ASAP that I also needed reshape loaded and not just reshape2. Hmmm tried that and I had some output but not the correct format. What I need is to run simulations of time overlap between species as per the simulation program data input constraints: The basis for the

Re: [R] sample {base}

2013-06-05 Thread Xochitl CORMON
Thank you Sarah for this code, it's exactly what I wanted to reach. Le 05/06/2013 16:49, Sarah Goslee a écrit : What about using instead size = min(5, length(Gpool$SampleNb[Gpool$LngtClas == LngtClas[[4]]& Gpool$SpCode == SpCode[[2]]]) that would make sure your sample is either the size of t

Re: [R] split and common variables

2013-06-05 Thread arun
Hello, May be this helps: dta1<-do.call(data.frame,dta) dta2<-dta1[complete.cases(dta1),] dta2[,-3]<-lapply(dta2[,-3],as.character) lstdta2<-split(dta2,dta2$place) library(plyr) #Some names are common in a few, but not in all the places. If you are looking for names common in 2 places, 3, places,

Re: [R] reshape2 issue

2013-06-05 Thread Pascal Oettli
Hello, "cast" is in "reshape" library. Is it loaded? Regards, Pascal 2013/6/5 Neotropical bat risk assessments > Hi all, > > I am revisiting using reshape2 to aggregate critter (bats) occurrences > by time blocks and have the final output for each row sum a percentage > such that the row sums

Re: [R] SPlus script

2013-06-05 Thread Pascal Oettli
Hello, 1) It is always nice to say something as "Hello", 2) What do you want us to do with that script, without the required "commented, minimal, self-contained, reproducible code"? 3) The lastest version of R is 3.0.1. Regards, Pascal 2013/6/5 Scott Raynaud > This originally was an SPlus scr

Re: [R] sample {base}

2013-06-05 Thread David Carlson
Something like this? > set.seed(42) > a <- sample.int(10) > b <- sample.int(5) > c <- sample.int(3) > smpl <- function(x) sample(x, ifelse(length(x)<5, length(x), 5)) > smpl(a) [1] 4 8 1 10 2 > smpl(b) [1] 2 3 5 1 4 > smpl(c) [1] 2 1 3 - David L Carlson Ass

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread Duncan Murdoch
On 05/06/2013 10:32 AM, ivo welch wrote: I just tested read.csv with files...it still works. it can read one line at a time (without col.names and with nrows). nice. it loses its type memory across reinvokcations, but this is usually not a problem if one reads a few thousand lines inside a

Re: [R] sample {base}

2013-06-05 Thread Sarah Goslee
What about using instead size = min(5, length(Gpool$SampleNb[Gpool$LngtClas == LngtClas[[4]] & Gpool$SpCode == SpCode[[2]]]) that would make sure your sample is either the size of the data or 5. Sarah On Wed, Jun 5, 2013 at 10:27 AM, Xochitl CORMON wrote: > Hi all, > > I'm trying to randomly se

[R] reshape2 issue

2013-06-05 Thread Neotropical bat risk assessments
Hi all, I am revisiting using reshape2 to aggregate critter (bats) occurrences by time blocks and have the final output for each row sum a percentage such that the row sums total 1 (100%). Reshape2 library is loaded on start. The old code I had stored in NotePad++ seems to no longer work as I

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Julio Sergio
Rui Barradas sapo.pt> writes: > My solution works but it is incorrect. We should force the argument 'c', > > faux <- function(c) { > force(c) > function (x) get(paste0(c,"gamma"))(x,k,scale=theta) > } Thanks a lot, Rul. I think I have to learn a bit more about lazy evaluation of a

Re: [R] split and common variables

2013-06-05 Thread Nico Met
Dear Dr. David, Many thanks for your answer. Now, if I want to see if there are common "name"in those "places" , how can I do it? So, by common I mean, it might be compared with 2, 3, 4 all of them. All possible combinations Many thanks regards Nico On Mon, Jun 3, 2013 at 5:20 PM, David

[R] sample {base}

2013-06-05 Thread Xochitl CORMON
Hi all, I'm trying to randomly select sample numbers for length class groups (5 per length class). For this I'm using a loop FOR and the function sample () and specified a size for the sampling of 5. Unfortunately, one of the length class group does not contain 5 individuals. For me is not a

[R] Coefficients paths - comparison of ridge, lasso and elastic net regression

2013-06-05 Thread beginner
I would like to compare models selected with ridge, lasso and elastic net. Fig. below shows coefficients paths using all 3 methods: ridge (Fig A, alpha=0), lasso (Fig B; alpha=1) and elastic net (Fig C; alpha=0.5). The optimal solution depends on the selected value of lambda, which is chosen based

Re: [R] How to write a loop in R to select multiple regression model and validate it ?

2013-06-05 Thread beginner
This is not a homework but part of my research. -- View this message in context: http://r.789695.n4.nabble.com/How-to-write-a-loop-in-R-to-select-multiple-regression-model-and-validate-it-tp4668669p4668720.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] how to compute maximum of fitted polynomial?

2013-06-05 Thread Joseph Clark
Thank you all! This approach, using the 'polynom' library, did the trick. > library(polynom) # -6 + 11*x - 6*x^2 + x^3 > p0 <- polynomial(c(-6, 11, -6, 1)) # has zeros at 1, 2, and 3 > p1 <- deriv(p0); p2 <- deriv(p1) # first and second derivative > xm <- solve(p1) # maxima and minima of p0 > xma

Re: [R] Loop FOR with histogram() from lattice

2013-06-05 Thread Jeff Newmiller
If you have read the Posting Guide, you will know that you should have read ALL the FAQs before posting your question. http://cran.r-project.org/doc/FAQ/R-FAQ.html That said, this particular FAQ applies to any library that depends on grid graphics, including lattice and ggplot2. ---

Re: [R] Lattice, ggplot, and pointsize

2013-06-05 Thread Deepayan Sarkar
On Sun, May 26, 2013 at 12:47 AM, Milan Bouchet-Valat wrote: > Le mardi 21 mai 2013 à 21:39 +0100, Prof Brian Ripley a écrit : >> On 21/05/2013 21:24, Bert Gunter wrote: >> > At the risk of misunderstanding... (inline) >> > >> > On Tue, May 21, 2013 at 12:17 PM, Milan Bouchet-Valat >> > wrote: >

Re: [R] dates and time series management

2013-06-05 Thread arun
Hi, Try this: lstf1<- list.files(pattern=".txt") length(lstf1) #[1] 119 fun2<- function(lstf){  lst1<-lapply(lstf,function(x) readLines(x))  lst2<-lapply(lst1,function(x) {gsub("(\\d+)(-.99)","\\1 \\2",x)})  lst3<-lapply(lst2,function(x) {x<-gsub("(\\d+)(-.99)","\\1 \\2",x)})  lst4<- lapply

[R] SPlus script

2013-06-05 Thread Scott Raynaud
This originally was an SPlus script that I modifeid about a year-and-a-half ago.  It worked perfectly then.  Now I can't get any output despite not receiving an error message.  I'm providing the SPLUS script as a reference.  I'm running R15.2.2.  Any help appreciated.    ***

Re: [R] Post hoc power analysis for mixed-effects models

2013-06-05 Thread Ben Bolker
Kota Hattori canterbury.ac.nz> writes: > Dear all, I have been searching ways to run power analysis for > mixed-effects models. However, I have not been successful in the > research. Today I would like to ask your help. As long as I see from > my search, Martin Julien wrote a package called pamm

Re: [R] Survival aareg problem

2013-06-05 Thread Terry Therneau
On 06/05/2013 12:33 AM, r-help-requ...@r-project.org wrote: Dear friends - I'm on windows 7, R 2.15.2 when I run the example for aareg in survival package I see this: plot(lfit[4], ylim=c(-4,4)) error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread Duncan Murdoch
On 13-06-05 12:08 AM, ivo welch wrote: thx, greg. chunk boundaries have meanings. the reader needs to stop, and buffer one line when it has crossed to the first line beyond the boundary. it is also problem that read.csv no longer works with files---readLines then has to do the processing. (st

Re: [R] How to display multiples lines with different color on the same plot?

2013-06-05 Thread David Winsemius
On Jun 4, 2013, at 3:05 PM, Kaptue Tchuente, Armel wrote: Hi all, I'm struggling with the display of several regression lines (with different colors) on the same plot. I manually drew what I'm trying to do with 8 lines (see attached). If you want lines that only span a portion of a plot

Re: [R] how to compute maximum of fitted polynomial?

2013-06-05 Thread Hans W Borchers
David Winsemius comcast.net> writes: > [...] > > On Jun 4, 2013, at 10:15 PM, Hans W Borchers wrote: > > > In the case of polynomials, "elementary math ... methods" can > > actually be > > executed with R: library(polynomial) # -6 + 11*x - 6*x^2 + x^3 p0 <- polynomial

Re: [R] how to compute maximum of fitted polynomial?

2013-06-05 Thread David Winsemius
On Jun 4, 2013, at 10:15 PM, Hans W Borchers wrote: Bert Gunter gene.com> writes: 1. This looks like a homework question. We should not do homework here. 2. optim() will only approximate the max. 3. optim() is not the right numerical tool for this anyway. optimize() is. 4. There is nev

Re: [R] Post hoc power analysis for mixed-effects models

2013-06-05 Thread David Winsemius
On Jun 4, 2013, at 4:46 PM, Kota Hattori wrote: Dear all, I have been searching ways to run power analysis for mixed-effects models. However, I have not been successful in the research. Today I would like to ask your help. As long as I see from my search, Martin Julien wrote a package call

Re: [R] How to display multiples lines with different color on the same plot?

2013-06-05 Thread Rui Barradas
Hello, See the help pages for ?abline ?par # parameter 'col' Hope this helps, Rui Barradas Em 04-06-2013 22:05, Kaptue Tchuente, Armel escreveu: Hi all, I'm struggling with the display of several regression lines (with different colors) on the same plot. I manually drew what I'm trying t

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Rui Barradas
Hello, My solution works but it is incorrect. We should force the argument 'c', not the return value. Like said in the help page for force. Which I've only read after my first post. The following way makes much more sense and is a bit shorter. faux <- function(c) { force(c) f

[R] Send Mail R and Socket Connections

2013-06-05 Thread TwistedSkies
Good Afternoon All, I am attempting to use the SendMailR function, I have checked with our I.T. department that I am using the correct server and I have the right permissions to connect and they have sent emails via this server but not through R and I have also checked that the port should be 25.

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-05 Thread Rui Barradas
Hello, If in faux we ?force the return value, the bug is gone. faux <- function(c) { f <- function (x) get(paste0(c,"gamma"))(x,k,scale=theta) force(f) f } Hope this helps, Rui Barradas Em 05-06-2013 07:13, Michael Weylandt escreveu: On Jun 5, 2013, at 3:53, Julio

Re: [R] Loop FOR with histogram() from lattice

2013-06-05 Thread Xochitl CORMON
Hi Jim, Thank you a lot. Is it a FAQ concerning lattice or FOR loop in general? Regards, Xochitl C. Le 05/06/2013 10:55, Jim Holtman a écrit : This is an FAQ. you have to explicitly 'print' the histogram: print(histogram(~ Mpool[[2]]$LngtClas | Mpool[[2]]$SpCode, type = "count", col = "lig

Re: [R] Loop FOR with histogram() from lattice

2013-06-05 Thread Jim Holtman
This is an FAQ. you have to explicitly 'print' the histogram: print(histogram(~ Mpool[[2]]$LngtClas | Mpool[[2]]$SpCode, type = "count", col = "lightgrey", xlab= "LngtClas", main = paste("Length distribution per species for Mpool", "2", sep = "_"))) Sent from my iPad On Jun 5, 2013, at 4:37,

Re: [R] Loop FOR with histogram() from lattice

2013-06-05 Thread Gerrit Eichner
Hi, Xochitl, wrapping the call to histogram() inside your loop in a call to print() should solve your problem: print( histogram( .)) Regards -- Gerrit On Wed, 5 Jun 2013, Xochitl CORMON wrote: Hi all, I'm encountering a problem I do not understand on my data: library (lattice) M

[R] Loop FOR with histogram() from lattice

2013-06-05 Thread Xochitl CORMON
Hi all, I'm encountering a problem I do not understand on my data: library (lattice) Mpool1 <- Table[Table$Subarea %in% c("52E9", "51E9"),] Mpool2 <- Table[Table$Subarea %in% c("53F0", "52F0"),] Mpool3 <- Table[Table$Subarea %in% c("51F0", "50F0"),] Mpool4 <- Table[Table$Subarea %in% c("51F1",