[R] monte carlo simulations in permanova in vegan package

2015-10-27 Thread Sean Porter
Dear colleagues, I am trying to run a PERMANOVA in the vegan package with an appropriate number of permutations (see example below), ideally . Obviously that number of permutations does not exists so I would like to use Monte Carlo permutation tests to derive the probability value, as is

Re: [R] monte carlo simulations in permanova in vegan package

2015-10-27 Thread stephen sefick
The example code works, and reports permutations. Can you provide more information? data(dune) data(dune.env) adonis(dune ~ Management*A1, data=dune.env, permutations=) On Tue, Oct 27, 2015 at 3:56 AM, Sean Porter wrote: > Dear colleagues, > > > > I am trying to

[R] Failed to read UTF-16LE file on Windows

2015-10-27 Thread Wush Wu
Dear all, I tried to run the following code on 3 different OS: ``` download.file(" https://raw.githubusercontent.com/wush978/DataScienceAndR/course/RBasic-07-Loading-Dataset/orglist-100.CSV;, destfile = "orglist-100.CSV") con <- file("orglist-100.CSV", encoding = "UTF-16LE") src <-

[R] An R data set with both numerical and categorical variables and a two-class response (at least 15 variables)

2015-10-27 Thread Farideh Bagherzadeh via R-help
Hi I need a data set containing both numerical and categorical variables and a two-class outcome to be used in examples of my R package (for variable selection). Do you know any well-known one? I prefer it to be related to healthcare and to have at least about 15 variables.   Regards Farideh

[R] HPbayes

2015-10-27 Thread Marwah Sabry Siam
Dear R-team, I am using HPbayes package, specificaly hp.bm.imis function in it. When I run the function it sometimes gives this error Error in eigen(m, only.values = TRUE, symmetric = TRUE) : infinite or missing values in 'x' even though in my data there isn't any missing values or infinte

Re: [R] Having trouble updating and installing R 3.2.1 and 3.2.2

2015-10-27 Thread Jeff Newmiller
You might also want to try a different mirror. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Having trouble updating and installing R 3.2.1 and 3.2.2

2015-10-27 Thread Keith S Weintraub
Jeff et. al (although there are no others so far on this thread). I finally gave up and decided to use 4.2 below from the "R for Windows FAQ” _ 4.2 I don’t have permission to write to the R-3.2.2\library directory. You can install packages

Re: [R] Memory problems with mice

2015-10-27 Thread Michael Dewey
Dear Jennifer See inline below On 27/10/2015 12:20, Lorenz, Jennifer wrote: Hi everyone, I am trying to perform a multiple imputation with mice on a dataset of about 13000 observations and 178 variables. I can start an "empty" imputation ("imp_start <- mice(data, maxit=0)"), but after a few

[R] How to use curve() with two parameters in the function

2015-10-27 Thread C W
Dear R list, I am trying to plot the curve of a function. Here's the R code: library(mvtnorm) p <- function(x, mu){ mu <- c(mu, 0) dmvnorm(c(x, 1), mu, diag(2)) } > curve(p(x, 2), from = 0, to =1) Error in dmvnorm(c(x, 1), mu, diag(2)) : mean and sigma have non-conforming size I

Re: [R] monte carlo simulations in permanova in vegan package

2015-10-27 Thread Cade, Brian
Sean: There are only 20 possible combinations, 6!/(3! x 3!), so you just need to enumerate them completely (no Monte Carlo approximation required). I don't know if permanova() can do this but you can do it with the mrpp() functions and argument (,exact=TRUE) in Blossom package for R. Brian

Re: [R] monte carlo simulations in permanova in vegan package

2015-10-27 Thread stephen sefick
Look at the permute package. I believe this functionality is there. Please excuse my brevity; this message was sent from my telephone. On Oct 27, 2015 10:55 AM, "Cade, Brian" wrote: > Sean: There are only 20 possible combinations, 6!/(3! x 3!), so you just > need to enumerate

[R] How to get variable name while doing series of regressions in an automated manner?

2015-10-27 Thread Ravi Varadhan
Hi, I am running through a series of regression in a loop as follows: results <- vector("list", length(mydata$varnames)) for (i in 1:length(mydata$varnames)) { results[[i]] <- summary(lm(log(eval(parse(text=varnames[i]))) ~ age + sex + CMV.status, data=mydata)) } Now, when I look at the

Re: [R] How to get variable name while doing series of regressions in an automated manner?

2015-10-27 Thread Bert Gunter
Marc,Ravi: I may misunderstand, but I think Marc's solution labels the list components but not necessarily the summary() outputs. This might be sufficient, as in: > z <- list(y1=rnorm(10,5),y2 = rnorm(10,8),x=1:10) > > ##1 > results1<-lapply(z[-3],function(y)lm(log(y)~x,data=z)) >

Re: [R] rgl plot rotation with device other than mouse

2015-10-27 Thread santiago gil
Well, I haven't built the device yet, I'm trying to figure out what my options will be. In the case of plugging in a simple USB trackball, I suppose it can work with the HID Manager in Mac to customize the signal from it. In general, would it be possible to manipulate the plot, say for example,

Re: [R] rgl plot rotation with device other than mouse

2015-10-27 Thread Duncan Murdoch
On 27/10/2015 1:38 PM, santiago gil wrote: Hello R, I'm trying to figure out if it would be possible use a device (maybe simply a trackball) separate from the mouse that would have the ability to rotate a 3D plot made with rgl without any buttons. This is to build an interactive "demo"-like

[R] Extract entries from matrix

2015-10-27 Thread Jorge I Velez
Dear R-help, I am working with a matrix "m" from which I would like to extract some elements. An toy example is as follows: ## input matrix m <- structure(c(0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

Re: [R] How to get variable name while doing series of regressions in an automated manner?

2015-10-27 Thread Marc Schwartz
> On Oct 27, 2015, at 10:19 AM, Ravi Varadhan wrote: > > Hi, > > I am running through a series of regression in a loop as follows: > > results <- vector("list", length(mydata$varnames)) > > for (i in 1:length(mydata$varnames)) { > results[[i]] <-

Re: [R] How to use curve() with two parameters in the function

2015-10-27 Thread C W
Never mind, I figured it out. You need to use sapply(), for instance, curve(sapply(x, p), from = 0, to =10) Thanks all! On Tue, Oct 27, 2015 at 11:14 AM, C W wrote: > Dear R list, > > I am trying to plot the curve of a function. > > Here's the R code: > > library(mvtnorm) >

[R] rgl plot rotation with device other than mouse

2015-10-27 Thread santiago gil
Hello R, I'm trying to figure out if it would be possible use a device (maybe simply a trackball) separate from the mouse that would have the ability to rotate a 3D plot made with rgl without any buttons. This is to build an interactive "demo"-like piece for which a mouse or trackpad is an

[R] Neuralnet package in R gives wrong output

2015-10-27 Thread Marijan Sapina
I'm trying to generate prediction of the column "dubina" using this algorithm made in R's "neuralnet" package. But I keep getting non-reliable neural-net output. I have tried changing the number of hidden layers, normalizing and denormalizing data. Is there a mistake in the algorithm, maybe

[R-es] pregunta

2015-10-27 Thread jbetancourt
Estimados Cuando existia epicalc, hab�a una manera muy f�cil de determinar la media de una variable (en esta caso Gain) por grupos, en este caso (Diet). ?Como se puede hacer ahora? Diet Gain 1d1 270 2d1 300 3d1 280 4d1 280 5d1 270 6d2 290 7d2 250 8

Re: [R] warning on generic function when building R package

2015-10-27 Thread David Stevens
Sorry to be a late comer to this problem but I'm having a similar issue. My function is called by ode from deSolve ADM1_C <- function(t,state,parameters,...){ with(as.list(c(state,parameters)), { # do some stuff here and return a list containing a vector of derivatives to ode ... }) } in

Re: [R] Time it takes to run a code

2015-10-27 Thread Maram SAlem
Thanks for helping Boris. Regards, Maram Salem On 25 October 2015 at 23:30, Boris Steipe wrote: > It may be useful for you to estimate the time complexity of your function: > try it with smaller input that takes short and noticeable time, see whether > the time

Re: [R] warning on generic function when building R package

2015-10-27 Thread Duncan Murdoch
On 27/10/2015 3:52 PM, David Stevens wrote: > Sorry to be a late comer to this problem but I'm having a similar > issue. My function is called by ode from deSolve > > ADM1_C <- function(t,state,parameters,...){ > > with(as.list(c(state,parameters)), { ># do some stuff here and return a

Re: [R] rgl plot rotation with device other than mouse

2015-10-27 Thread Duncan Murdoch
On 27/10/2015 2:35 PM, santiago gil wrote: > Well, I haven't built the device yet, I'm trying to figure out what my > options will be. In the case of plugging in a simple USB trackball, I > suppose it can work with the HID Manager in Mac to customize the signal > from it. > > In general, would it

Re: [R] How to get variable name while doing series of regressions in an automated manner?

2015-10-27 Thread Ravi Varadhan
Thank you very much, Marc & Bert. Bert - I think you're correct. With Marc's solution, I am not able to get the response variable name in the call to lm(). But, your solution works well. Best regards, Ravi -Original Message- From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent:

Re: [R] Extract entries from matrix

2015-10-27 Thread jim holtman
If you want to use the numbers you gave a the index into the matrix, then you can create a matrix with the values and then index into 'm'. I don't see a '4' in the output example you gave using your index values: > m <- structure(c(0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, + 1L, 1L,

Re: [R] Extract entries from matrix

2015-10-27 Thread Jorge I Velez
Dear Jim, Thank you very much for your quick reply. I am sorry for the confusion it may have caused, but I messed up the indexes in my example. I would like, from the following matrix "m" ## input m <- structure(c(0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 2L, 2L, 2L, 2L, 2L,

Re: [R] Extract entries from matrix

2015-10-27 Thread Jorge I Velez
Thank you all for your solutions and comments. As Dr. Carlson mentioned, we leave rows 1 to 3 out as they are all zeroes. Then, the entries I need to select from m are entry value 4,1 ---> 1 5,2 ---> 2 6,3 ---> 3 7,1 ---> 1 8,2 ---> 2 9,3 ---> 3 10,4

Re: [R-es] Una consultilla

2015-10-27 Thread Carlos Ortega
Hola, Creo que la función "switch()" te puede ayudar... Saludos, Carlos Ortega www.qualityexcellence.es El 27 de octubre de 2015, 21:22, heber sarmiento via R-help-es < r-help-es@r-project.org> escribió: > Cordial saludo > Quiero saber si alguien me puede orientar en lo siguiente, > he

Re: [R] Extract entries from matrix

2015-10-27 Thread David L Carlson
I don't see how you are getting the result you provide. > m [,1] [,2] [,3] [,4] [,5] [1,]00000 [2,]00000 [3,]00000 [4,]12300 [5,]12300 [6,]12300 [7,]123

Re: [R] [FORGED] Re: Extract entries from matrix

2015-10-27 Thread Rolf Turner
Maybe it's just me --- I'm notoriously slow --- but I haven't a clue what you are trying to do. You said: "... the idea is to extract the diagonal elements until a zero is found." I don't see anything that resembles a "diagonal element" (*entry*, actually; sets have elements, arrays

Re: [R-es] pregunta

2015-10-27 Thread eric
tambien te sirve la funcion data.table ... si no tienes instalado el paquete: install.packages("data.table") library(data.table) jbe <- as.data.table(read.table("tusdatos.txt")) jbe.ave <- jbe[, .("ave"=mean(Gain)), by=.(Diet)] > jbe.ave Diet ave 1: d1 280 2: d2 278 3: d3 312

[R] rms package: residual df for penalised ols

2015-10-27 Thread Mark Seeto
Dear R-help, In the rms package, when using the ols function with a penalty, the df.residual appears to always be n-1 (with n being the sample size). That seems strange to me, but I don't have much knowledge in this area. Here's an example: library(rms) set.seed(1) n <- 50 d <- data.frame(x1

[R] Distribution hist

2015-10-27 Thread bgnumis bgnum
Hi all, I have this data on "sim" variable 10403.000NANANANA 11178.000NANANANA 11521.000NANANANA 11385.000NANANANA 10102.000NANANANA

[R] coxme adequacy check

2015-10-27 Thread Cacique Samurai
Hello all! I´m fitting a mixed effects cox model with coxme function of coxme package. I want to konw what is the best way to check the model adequacy, once that function cox.zph that does not work for coxme objects. Thanks in advanced, Raoni -- Raoni Rosa Rodrigues Research Associate of Fish

[R] Memory problems with mice

2015-10-27 Thread Lorenz, Jennifer
Hi everyone, I am trying to perform a multiple imputation with mice on a dataset of about 13000 observations and 178 variables. I can start an "empty" imputation ("imp_start <- mice(data, maxit=0)"), but after a few minutes R stops with the following error message: Error: cannot allocate

Re: [R] monte carlo simulations in permanova in vegan package

2015-10-27 Thread Sean Porter
Hi Stephen and others, I am trying to run a one-way permanova where I have only 2 levels in the factor “time”, and each level contains only 3 replicates. So because I have such few observations (6 in total) and levels (2) there are not enough possible permutations to get a reasonable test