Re: [R] Lattice Package in R: Is it possible to develop an interactive “scatterplot/network”?

2015-10-29 Thread Bert Gunter
You need to go back and read an R tutorial (e.g. the Intro to R one that ships with R) about how functions pass ... arguments. Your customPanel2 function does not use the ... argument passed to it, so what you are trying to do by including it? Beyond that, I do not have the patience to go through

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

2015-10-29 Thread Jari Oksanen
Sean Porter ori.org.za> writes: > 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

Re: [R] Recover value from boot and quantile function

2015-10-29 Thread Peter Maclean via R-help
#This may be trivia for some but I am running several bootstraps and #I would like to create a table/data frame with original mean, std.error from the #x.boot object and confidence intervals from x.quant object. The boot and quantifile function do not show how. library(boot) x <-

[R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Victor Tian
Hi there, Often times, I would run R in the terminal when the task is computationally intensive and a nice-looking UI is less desired. However, pasting a large chunk of code into the terminal often times ends up being messed up. In Python, the same problem would happen, however, iPython provides

[R] Caret and Summary

2015-10-29 Thread Lorenzo Isella
Dear All, I trained a model, let's call it mm, using caret+Cubist. When I type summary(mm), the output is rather long. This is because a Cubist model is a long set of rules, partially reminiscent of a classification tree. How can I save summary(mm) in a printer/article friendly way when this is

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Marc Schwartz
> On Oct 29, 2015, at 10:16 AM, Victor Tian wrote: > > Hi there, > > Often times, I would run R in the terminal when the task is computationally > intensive and a nice-looking UI is less desired. > > However, pasting a large chunk of code into the terminal often times ends

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Marc Schwartz
> On Oct 29, 2015, at 10:43 AM, Marc Schwartz wrote: > > >> On Oct 29, 2015, at 10:16 AM, Victor Tian wrote: >> >> Hi there, >> >> Often times, I would run R in the terminal when the task is computationally >> intensive and a nice-looking UI is less

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Jeff Newmiller
I highly recommend ?source. You can use source("clipboard") on windows, but creating complete files that define functions and feeding those complete files to source is a significant step in developing reproducible analyses. Whenever you find yourself pasting more than a couple of lines (one or

[R] Achieve independent fine user control of ggplot geom settings when using groups in multiple geom's

2015-10-29 Thread sbihorel
Hello, Before I get to my question, I want to make clear that the topic of my present post is similar to posts I recently submitted to the list. Although I appreciate the replies I got, I believe that I did not correctly frame these previous posts to get to the bottom of things. I also want

Re: [R] vector of constant values

2015-10-29 Thread Bert Gunter
Have you read any R tutorials?? This is about as basic as it gets. ?rep -- Bert P.S. Due to vectorized operations, there is probably no need to do this anyway! Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On

[R] #2 (Thanks) → Consultation about reading hdf files from nsidc

2015-10-29 Thread Jorge Rabinovich
City Bell, Thursday, October 29, 2015, 14:10 Hi there: On 10/29/2015 10:12 AM, HDF-EOS Tools and Information Center Help wrote: Hi, Jorge! The AMSR-E file you're trying to read with R is HDF"4", not HDF"5" file format. Unfortunately, R does not support HDF4 directly. You can either convert

Re: [R] vector of constant values

2015-10-29 Thread Sarah Goslee
If you mean you need a matrix of that size, matrix(1, nrow=200, ncol=2) On Thu, Oct 29, 2015 at 1:07 PM, thanoon younis wrote: > Dear Members, > > I want to simulate a vector of constants values with dimention = 200x2 and > all values of this vector are 1. > > Any

Re: [R] vector of constant values

2015-10-29 Thread Gerrit Eichner
Hi, Thanoon! I want to simulate a vector of constants values with dimention = 200x2 and all values of this vector are 1. You mean "I want to _construct_ a _matrix_ of dimension 200 x 2 with all entries equal to 1", don't you? Homework? Take a look at ?matrix Hth -- Gerrit Any help

Re: [R] Achieve independent fine user control of ggplot geom settings when using groups in multiple geom's

2015-10-29 Thread Ista Zahn
I would say in a word, 'no'. What you seem to be implying is that you want multiple color scales, multiple shape scales, etc. As far as I know there is no support for that in ggplot2. Perhaps if you show us what you're actually trying to accomplish someone can suggest a solution or at least a

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Victor Tian
Thanks, Marc and Jeff, for the advice of running a file of R code rather than a chunk of R code. Just thought it would be nice to have a feature like this so that there's still a sense of interaction in running R code. It was a random idea and I think using "source" would achieve the same goal.

[R] vector of constant values

2015-10-29 Thread thanoon younis
Dear Members, I want to simulate a vector of constants values with dimention = 200x2 and all values of this vector are 1. Any help please. Regards -- Thanoon Y. Thanoon PhD Candidate Department of Mathematical Sciences Faculty of Science University Technology Malaysia, UTM E.Mail:

Re: [R] Caret and Summary

2015-10-29 Thread Kuhn, Max
On 10/29/15, 11:46 AM, "Lorenzo Isella" wrote: >Dear All, >I trained a model, let's call it mm, using caret+Cubist. >When I type summary(mm), the output is rather long. >This is because a Cubist model is a long set of rules, partially >reminiscent of a classification

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Victor Tian
Not a specific problem. Just an issue encountered pasting R codes in terminals from time to time. Cheers, Xu On Thu, Oct 29, 2015 at 2:46 PM, jim holtman wrote: > Another good reason for using "source" instead of copy/paste is that if an > error occurs, the 'sourced'

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread Jeff Newmiller
I don't get the impression that you understood the part of my response where I said the feature does exist. You might find reading ?file helpful, in particular the section titled "Clipboard". --- Jeff Newmiller

Re: [R] Pasting a large chunk of R code in terminals

2015-10-29 Thread jim holtman
Another good reason for using "source" instead of copy/paste is that if an error occurs, the 'sourced' script will stop at the error, while the copy/paste will keep on chugging away, knowing who does what in the rest of the script. Most of the editors I have used on Windows (notepad++, tinn-r)

Re: [R] Achieve independent fine user control of ggplot geom settings when using groups in multiple geom's

2015-10-29 Thread sbihorel
Thank you for your reply. I do not have anything specific data/geom/grouping in mind, rather a framework in which users would just pile of each other layer after layer of geom each defined with specific settings. A minimum realistic scenario would a geom_point followed by a geom_smooth or a

Re: [R] #2 (Thanks) → Consultation about reading hdf files from nsidc

2015-10-29 Thread David Winsemius
> On Oct 29, 2015, at 10:21 AM, Jorge Rabinovich wrote: > > City Bell, Thursday, October 29, 2015, 14:10 > > Hi there: > On 10/29/2015 10:12 AM, HDF-EOS Tools and Information Center Help wrote: >> Hi, Jorge! The AMSR-E file you're trying to read with R is HDF"4", not >>

Re: [R] #2 (Thanks) → Consultation about reading hdf files from nsidc

2015-10-29 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Thursday, October 29, 2015 11:51 AM To: jorge.rabinov...@gmail.com Cc: r-help@r-project.org; HDF-EOS Tools and Information Center Help Subject: Re: [R] #2 (Thanks) → Consultation about

[R] mapping between list and vector

2015-10-29 Thread Maxim via R-help
Hi, for some reason I have to map elements of a list "myList" (of vectors of different length) to a vector "myVec" as such: myList <- list(a="key1", b=c("key2","key3"), c="key4") myVec <- c("val1","val2","val3","val4") result <- list() lapply(myList,length) -> lngL j <- 1 for (i in

Re: [R] Achieve independent fine user control of ggplot geom settings when using groups in multiple geom's

2015-10-29 Thread Jeff Newmiller
I think a fundamental design principle of ggplot is that mapping of values to visual representation are consistent within a single plot, so reassigning color mapping for different elements would not be supported. That being said, it is possible to explicitly control specific attributes within

Re: [R] mapping between list and vector

2015-10-29 Thread Adams, Jean
Maxim, I'm not sure how much faster this would be ... but you could test it out and see. I defined lngL and result as vectors instead of lists. And I calculated j outside of the "loop". myList <- list(a="key1", b=c("key2","key3"), c="key4") myVec <- c("val1","val2","val3","val4") lngL <-

[R] find max. value for a equation by optimize

2015-10-29 Thread Jianling Fan
Hello, everyone, I have a specific equation, When I draw it out, I found there is a max. value for it at about x=5. but I couldn't point it out by optimize(). Does anyone know why? Thanks! my code is: d50<-18.04 c<- -1.276 dm<-147 sm <- function (x) {

Re: [R] find max. value for a equation by optimize

2015-10-29 Thread Jianling Fan
Oops! Thanks a lot! Jean On 29 October 2015 at 15:45, Adams, Jean wrote: > If you read the help file for optimize, you will see that you need to set > the argument maximum to TRUE. > > ?optimize > > optimize(sm, c(0, 50), maximum=TRUE) > > Jean > > On Thu, Oct 29, 2015 at

[R] find all unit vectors which are orthogonal to a given vector

2015-10-29 Thread Marco Inacio
Is there a function in R to get the set of all unit vectors which are orthogonal to a given vector? __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] find all unit vectors which are orthogonal to a given vector

2015-10-29 Thread Duncan Murdoch
On 29/10/2015 6:38 PM, Marco Inacio wrote: > Is there a function in R to get the set of all unit vectors which are > orthogonal to a given vector? No. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] find max. value for a equation by optimize

2015-10-29 Thread Adams, Jean
If you read the help file for optimize, you will see that you need to set the argument maximum to TRUE. ?optimize optimize(sm, c(0, 50), maximum=TRUE) Jean On Thu, Oct 29, 2015 at 4:19 PM, Jianling Fan wrote: > Hello, everyone, > > I have a specific equation, When I

Re: [R] User-defined functions in dplyr

2015-10-29 Thread Jeff Newmiller
You are jumping the gun (your other email did get through) and you are posting using HTML (which does not come through on the list). Some time (re)reading the Posting Guide mentioned at the bottom of all emails on this list seems to be in order. The error is actually quite clear. You should

Re: [R] find all unit vectors which are orthogonal to a given vector

2015-10-29 Thread Marco Inacio
I think that's just what I needed. Thanks! On 2015-10-29 09:55 PM, peter dalgaard wrote: On 30 Oct 2015, at 00:03 , Duncan Murdoch wrote: On 29/10/2015 6:38 PM, Marco Inacio wrote: Is there a function in R to get the set of all unit vectors which are orthogonal to a

Re: [R] find all unit vectors which are orthogonal to a given vector

2015-10-29 Thread Marco Inacio
Ok, thanks! On 2015-10-29 09:03 PM, Duncan Murdoch wrote: On 29/10/2015 6:38 PM, Marco Inacio wrote: Is there a function in R to get the set of all unit vectors which are orthogonal to a given vector? No. Duncan Murdoch __ R-help@r-project.org

Re: [R] Achieve independent fine user control of ggplot geom settings when using groups in multiple geom's

2015-10-29 Thread sbihorel
Thank for your reply, I may accept your point about the mapping consistency when the different geom's use the same data source. However, as pointed out in my example code, this does not have to be the case. Hence my question about the geom-specific control of group-dependent graphical

[R] User-defined functions in dplyr

2015-10-29 Thread Axel Urbiz
Hello, Sorry, resending this question as the prior was not sent properly. I’m using the plyr package below to add a variable named "bin" to my original data frame "df" with the user-defined function "create_bins". I'd like to get similar results using dplyr instead, but failing to do so.

Re: [R] find all unit vectors which are orthogonal to a given vector

2015-10-29 Thread peter dalgaard
> On 30 Oct 2015, at 00:03 , Duncan Murdoch wrote: > > On 29/10/2015 6:38 PM, Marco Inacio wrote: >> Is there a function in R to get the set of all unit vectors which are >> orthogonal to a given vector? > > No. Building blocks should be there, though. The last n-1

[R] User-defined functions in dplyr

2015-10-29 Thread Axel Urbiz
Hello, I’m using the plyr package to add a variable named "bin" to my original data frame "df" with a user-defined function "create_bins". I'd like to get similar results using dplyr instead, but failing to do so. set.seed(4)df <- data.frame(pred = rnorm(100), models = gl(2, 50, 100, labels =

Re: [R] rbind - names in dataframe. Beginner Question

2015-10-29 Thread Gerrit Eichner
Hello, Sarah, take a look at the online help page of the function cut() (and apply the function to the Hunger-column). Hth -- Gerrit On Thu, 29 Oct 2015, Dagmar wrote: Dear Sarah, (dear All), Thank you for trying to help! You are right, that I want to add a column to my dataframe with

Re: [R] rbind - names in dataframe. Beginner Question

2015-10-29 Thread Dagmar
Dear Sarah, (dear All), Thank you for trying to help! You are right, that I want to add a column to my dataframe with a corresponding value to the Hunger column. Your solution is basically correct in the result but my data are a little more complicated. Maybe that example describes it better:

Re: [R] rbind - names in dataframe. Beginner Question

2015-10-29 Thread ruipbarradas
Hello, Try the following. newframe <- myframe newframe$Hungertype <- with(myframe, ifelse(Hunger <= 1, NA,                             ifelse(1 < Hunger & Hunger <= 2, "Hunger",                             ifelse(Hunger < 3, "bigHUnger", "verybigHunger") ))) Note that the new column is of type

[R] Specifying interactions in coxme

2015-10-29 Thread Patrick Phillips
I am trying to estimate variance components from a complex random effects survival model using coxme (Package version 2.2-5). I am having problems specifying interaction effects in the random terms. I wonder if this is simply not implemented in coxme yet. For instance, using the model

Re: [R] rbind - names in dataframe. Beginner Question

2015-10-29 Thread Dagmar
Hello Rui and Gerrit and Sarah, Thank you very much for your help. I finally got it to work! Have a great day! Dagmar Am 29.10.2015 um 08:38 schrieb ruipbarra...@sapo.pt: > > Hello, > > Try the following. > > > newframe <- myframe > newframe$Hungertype <- with(myframe, ifelse(Hunger <= 1, NA, >

[R] problem in running a plspm ...

2015-10-29 Thread deva d
i am getting this error when i give the command for running a plspm ... requesting someone to pl help ... > MARCAP_PLS=plspm(Partialmodelfields,MARCAP_Path,MARCAP_Blocks,modes= MARCAP_Modes) Error in if (w_dif < specs$tol || iter == specs$maxiter) break : missing value where TRUE/FALSE needed

Re: [R] install.packages() can't find install.packages() ?

2015-10-29 Thread Emma Hsueh
Hi Rolf, Looks like it is indeed the Halloween ghosts! I did what you said and it worked. Thank you! Do you know how the .RData might have gotten corrupted? Thanks again, Emma Rolf Turner 於 2015年10月29日 星期四寫道: > > > Have you tried this after starting R in a "clean"

Re: [R] install.packages() can't find install.packages() ?

2015-10-29 Thread Boris Steipe
Emma - do installations still work after you switch the startup script back on that I suggested you comment out? I'm specifically asking about loading plot3D... As far as I'm concerned "it worked" would mean: you can load plot3D and magrittr through the startup script and then R is just fine

Re: [R] install.packages() can't find install.packages() ?

2015-10-29 Thread Emma Hsueh
I turned the startup script back on and tried installing stringr. It went smoothly. Seems like the ghosts are gone. No clue how the corruption happened though. Thanks to both of you! Happy Halloween :D Best, Emma Boris Steipe 於 2015年10月30日 星期五寫道: > Emma - do

[R] install.packages() can't find install.packages() ?

2015-10-29 Thread Boris Steipe
We are seeing the following problem when trying to install magrittr on Ubuntu 14.04 install.packages("magrittr") Installing package into ‘/home/ehsueh/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- trying URL

Re: [R] install.packages() can't find install.packages() ?

2015-10-29 Thread Rolf Turner
Have you tried this after starting R in a "clean" workspace? Or perhaps after starting R --vanilla? It sounds to me like something is corrupted in your install.packages() function --- or possible somewhere else --- which could be induced by having some ghosts lurking about in .RData.

Re: [R-es] Extraer elementos diagonales de submatrices

2015-10-29 Thread Olivier Nuñez
Jorge, si creas un índice ("dd" en mi código) para las diagonales (las "cohortes" en un diagrama de Lexis), se puede elaborar un script más o menos elegante para hallar tu output: require(data.table) temp=data.table(m) temp[,row:=1:nrow(m)] D=melt(temp,id.vars="row",variable.name = "col")

Re: [R-es] Extraer elementos diagonales de submatrices

2015-10-29 Thread Olivier Nuñez
Bueno, habia un pequeño bug. Aproveché para simplificar el codigo: require(data.table) temp=data.table(m) temp[,row:=1:nrow(m)] D=melt(temp,id.vars="row",variable.name = "col") D[,col:=as.numeric(factor(col))] D[,dd:=(ncol(m)-col)+row] #determina la diagonal DD=subset(D,dd>=ncol(m))

[R-es] Problema con NA en un csv proveniente de una BDD de access

2015-10-29 Thread Isa García Barón
Hola a todos, Tengo un problema a la hora de realizar subsets en un csv. Este csv proviene de haber seleccionado una serie de datos a partir de una BDD Access mediante el paquete RODBC. Hay una serie de datos que son introducidos mediante un formulario y otros pegados directamente en la BDD.

Re: [R-es] Extraer elementos diagonales de submatrices

2015-10-29 Thread Javier Rubén Marcuzzi
El código que me olvide pegar input m <- structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5), .Dim = c(10L, 5L)) m ## output output

Re: [R-es] Extraer elementos diagonales de submatrices

2015-10-29 Thread Javier Rubén Marcuzzi
Estimado Jorge I Velez Tengo una idea que funcionaría y otra con problemas. La que funcionaría es simple, aunque puede ser algo lenta, básicamente es por un bucle ir recorriendo el índice de la matriz extrayendo el valor, índice1,1, luego 2,2, luego 3,3 …., en caso que el valor sea 0, pasar a

Re: [R-es] Problema con NA en un csv proveniente de una BDD de access

2015-10-29 Thread Carlos Ortega
Hola, ¿Puedes compartir una parte de ese csv que tiene los NA para verlo más despacio?... Gracias, Carlos Ortega www.qualityexcellence.es El 29 de octubre de 2015, 11:47, Isa García Barón escribió: > Hola a todos, > > > > Tengo un problema a la hora de realizar subsets en un

Re: [R-es] Problema con NA en un csv proveniente de una BDD de access

2015-10-29 Thread Francisco Rodriguez Sanchez
Hola Isa, No sé si he entendido bien, pero en vez de subset(juv12, distance=="NA") prueba con is.na subset(juv12, is.na(distance)) Por ejemplo: http://stackoverflow.com/questions/7980622/subset-of-rows-containing-na-missing-values-in-a-chosen-column-of-a-data-frame Suerte Paco El