Re: [R] lm() with spearman corr option ?

2016-04-28 Thread Bert Gunter
Please read ?lm! -- where it says: method: the method to be used; for fitting, currently only method = "qr" is supported; method = "model.frame" returns the model frame (the same as with model = TRUE, see below). More to the point, your request for a "spearman" method for lm() makes little or

[R] lm() with spearman corr option ?

2016-04-28 Thread Hoji, Akihiko
Hi, A following function was kindly provided by GGally’s maintainer, Barret Schloerke. function(data, mapping, ...) { p <- ggplot(data = data, mapping = mapping) + geom_point(color = I("blue")) + geom_smooth(method = "lm", color = I("black"), ...) + theme_blank() +

Re: [R] Package to work with weight based data

2016-04-28 Thread David Winsemius
> On Apr 28, 2016, at 9:32 AM, BISWAJIT KAR wrote: > > Respected all, >I am working on a socio-economic survey (named as > National Sample Survey in India provided by National Sample Survey > Organization, Govt. of India) data of individual as well as

Re: [R] Create a new variable and concatenation inside a "for" loop

2016-04-28 Thread David Winsemius
> On Apr 28, 2016, at 4:51 AM, Gordon, Fabiana > wrote: > > > Maybe I wasn't clear about my query. > > I'm very familiar with pre-allocation and vectorization and I had already > wrote an R code for this problem in this way. My question wasn't about the >

[R] Package to work with weight based data

2016-04-28 Thread BISWAJIT KAR
Respected all, I am working on a socio-economic survey (named as National Sample Survey in India provided by National Sample Survey Organization, Govt. of India) data of individual as well as households. This is a sample survey where stratified random sapling method has been

Re: [R] Create a new variable and concatenation inside a "for" loop

2016-04-28 Thread MacQueen, Don
What's not possible, as far as I know, is to create a variable using an expression that refers to elements within the variable. For example, suppose that a some point during my R session, there is no variable named tmpx: > exists('tmpx') [1] FALSE If I try to reference tmpx, in this case by

Re: [R-es] Combinaciones sin repetición...con restricciones

2016-04-28 Thread giltrapo
Hola, Carlos. Primero, muchas gracias por el código. No es exactamente lo que quería, porque la parte "Detección de presencia de "cual_1" y "cual_2"... no excluye aquellas combinaciones en las que está presente también el objeto c, pero me ha servido de base e inspiración para elaborar otro

[R] New book: Beginner's Guide to Zero-Inflated Models with R

2016-04-28 Thread Highland Statistics Ltd
We are pleased to announce the following book: Title: Beginner's Guide to Zero-Inflated Models with R Authors: Zuur, Ieno Book website: http://www.highstat.com/BGZIM.htm Paperback or EBook can be order (exclusively) from: http://www.highstat.com/bookorder.htm TOC:

[R] Snowfall - Error in checkForRemoteErrors(val) with sfClusterApplyLB()

2016-04-28 Thread Marine Regis
Hello, I'm trying to run a code that uses the snowfall package. Here is the structure of my code. sfInit(parallel=T, cpus = 5, slaveOutfile="ErrorMessage.txt") sfExportAll() sfLibrary(rgdal) sfLibrary(raster) sfLibrary(sp) sfLibrary(rgeos) sfLibrary(snowfall) system.time(

Re: [R] polygon angle option perpendicular to axis

2016-04-28 Thread Simon, Heather
Thanks, adding asp = 1 did the trick! -Original Message- From: David L Carlson [mailto:dcarl...@tamu.edu] Sent: Thursday, April 28, 2016 12:17 PM To: Greg Snow <538...@gmail.com>; Simon, Heather Cc: r-help@r-project.org Subject: RE: [R] polygon angle option

Re: [R] polygon angle option perpendicular to axis

2016-04-28 Thread David L Carlson
The angle is not based on the polygon edges, but it can seem that way if you do not use the asp=1 argument in your plot. Try this example, > plot(1:10, 1:10, type='n') > x <- c(1, 3, 5, 3) > y <- c(3, 5, 3, 1) > polygon(x, y, angle=0, density=10) > polygon(x, y + 4.5, angle=45, density=10) >

Re: [R] polygon angle option perpendicular to axis

2016-04-28 Thread William Dunlap via R-help
I think you are seeing the Moire (interference) pattern arising from the interaction of lty=4 (dotted/dashed lines) and closely spaced parallel lines. Use lty=1 (solid lines) to see this. [BTW, your script did not work because you changed the capitalization of top and bottom halfway through it.]

[R] Antwort: Re: R Script Template

2016-04-28 Thread G . Maubach
Hi All, please find enclosed the missing attachment. Kind regards Georg -- cut -- #-[ Header ] -- # Program : Framework for R scripts # Author: Georg Maubach # Date : 2016-03-03 # Update:

Re: [R] how to donate software to R community

2016-04-28 Thread Marc Schwartz
> On Apr 27, 2016, at 11:37 PM, WU Qingwei wrote: > > hi all, > > > We have developed a software called HCBA (Highly Consumable Business > Analytics) using R as modelling engine. > We now want to donate the whole software (R serves only as modelling engine > in this project.

Re: [R] Create a new variable and concatenation inside a "for" loop

2016-04-28 Thread Gordon, Fabiana
Maybe I wasn't clear about my query. I'm very familiar with pre-allocation and vectorization and I had already wrote an R code for this problem in this way. My question wasn't about the most efficient way to solve the problem. It was about whether in R it was possible to use the same

Re: [R] Random effects in package mgcv

2016-04-28 Thread Simon Wood
If you want to include random intercepts in a model fit by bam/gam, then include s(g,bs="re") in the model formula, where g is a factor variable with one level for each group requiring a random intercept. Now suppose that for each level of group g you want a random slope w.r.t. x. You should

[R] [R-pkgs] New package: bridgedist (v 0.1.0)

2016-04-28 Thread Bruce Swihart
R Users, The d/p/q/r functions for the bridge distribution are now available in bridgedist. When a random intercept follows the bridge distribution, as detailed in Wang and Louis (2003) http://dx.doi.org/10.1093/biomet/90.4.765>>, a marginalized random-intercept logistic regression will still be

[R] [R-pkgs] New R package on CRAN: RZabbix - easy and direct communication with 'Zabbix API'

2016-04-28 Thread Marcin Kosiński
Hi all, 2 days ago a new R packages appeared on CRAN https://cran.r-project.org/web/packages/RZabbix/index.html RZabbix is an R interface to the 'Zabbix API' data < https://www.zabbix.com/documentation/3.0/manual/api/reference>. Enables easy and direct communication with 'Zabbix API' from 'R'.

Re: [R] Same sum, different sets of integers

2016-04-28 Thread Atte Tenkanen
Thanks for the suggestions, all of you! I first began to think about using somehow permutations of the gtools-package. I will continue utilizing Peter's solution. My purpose is to divide basic musical rhythm units (whole note, half note, quarter note etc durations) to meaningful entities in

[R] how to donate software to R community

2016-04-28 Thread WU Qingwei
hi all, We have developed a software called HCBA (Highly Consumable Business Analytics) using R as modelling engine. We now want to donate the whole software (R serves only as modelling engine in this project. There are other core functions.) to the R community and open-source it. But we

Re: [R] polygon angle option perpendicular to axis

2016-04-28 Thread Simon, Heather
Thanks for the question. Here is a sample of the code for my plot: Top = c(34, 39, 42, 45, 46, 41, 41, 40, 43, 38, 33, 33) Bottom = c(24, 29, 32, 36, 32, 34, 32,41, 40, 39, 29, 24) plot(1,1, col = "white", xlim = c(1.3,11.7), ylim = c(0,80), axis = FALSE, xaxt = "n")

[R] [R-pkgs] New package: msmtools (v1.0)

2016-04-28 Thread Francesco Grossetti
Greetings, R users! It is with pleasure that I am announcing the release of msmtools package on CRAN: https://cran.r-project.org/web/packages/msmtools/index.html msmtools provides a fast and general method for restructuring classical longitudinal data into augmented ones. The reason for this

Re: [R] polygon angle option perpendicular to axis

2016-04-28 Thread Greg Snow
Filling polygons with lines is a throwback to the time when the height of quality graphics was the mechanical pen plotter (a device that used a pen in a mechanical arm to draw the plot on a piece of paper). Computing and printing technology has advanced quite a bit from that day, so you may want

Re: [R-es] Combinaciones sin repetición...con restricciones

2016-04-28 Thread Javier Marcuzzi
Estimado José Ignacio Entonces entiendo que busca en una lista o data.frame tres condiciones con “o”. Si “contiene A” - o - Si “contiene B” – o -Si “contiene A y B” Haría que analizar si es lo mismo A y B o B y A. Javier Rubén Marcuzzi De: giltrapo Enviado: jueves, 28 de abril de 2016

Re: [R-es] Combinaciones sin repetición...con restricciones

2016-04-28 Thread giltrapo
Hola, Javier. La solución Objeto 1 (a) y Objeto 2 (b) cumple con la condición que puse, es decir, que estén presentes los objetos a y b, pero no el c. Asimismo, la solución Objeto 1 (a) y Objeto 4 (a y b), también cumple con esa condición. El objeto a está repetido dos veces, pero da igual, no es

[R] Robust clustered errors for probit ordinal regression analysis

2016-04-28 Thread Faradj Koliev
Dear all, I’ll need your help with obtaining robust clustered errors. I use polr command in MASS package m<–porl(y~x1+x2,data=mydata, method=probit). In the rms package, this is as simple as: clusterSE<–robcov(m, mydata$id). Is it possible to do something similar for polr object as well?

Re: [R] Determine if a set of x and y-latitude points are inside of a polygon using R

2016-04-28 Thread David L Carlson
Give us reproducible data using dput(). There are easier ways to accomplish what you want in R. The overwriting problem stems from the fact that you have a double loop so each iteration of the outer loop overwrites the data produced in the inner loop. Also your if/else specification should be

Re: [R] Antwort: RE: Interdependencies of variable types, logical expressions and NA

2016-04-28 Thread PIKAL Petr
Hi ?factor help page says rather cryptically The encoding of the vector happens as follows. First all the values in exclude are removed from levels. If x[i] equals levels[j], then the i-th element of the result is j. If no match is found for x[i] in levels (which will happen for excluded

Re: [R] Linear Regressions with constraint coefficients

2016-04-28 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Thx a lot Gabor! Aljosa Aleksandrovic, FRM, CAIA Quantitative Analyst - Convertibles aljosa.aleksandro...@man.com Tel +41 55 417 76 03 Man Investments (CH) AG Huobstrasse 3 | 8808 Pfäffikon SZ | Switzerland -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]

Re: [R] Linear Regressions with constraint coefficients

2016-04-28 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Hi Gabor, Thanks a lot for your help! I tried to implement your nonlinear least squares solver on my data set. I was just wondering about the argument start. If I would like to force all my coefficients to be inside an interval, let’s say, between 0 and 1, what kind of starting values are

Re: [R] Linear Regressions with constraint coefficients

2016-04-28 Thread Gabor Grothendieck
The nls2 package can be used to get starting values. On Thu, Apr 28, 2016 at 8:42 AM, Aleksandrovic, Aljosa (Pfaeffikon) wrote: > Hi Gabor, > > Thanks a lot for your help! > > I tried to implement your nonlinear least squares solver on my data set. I > was just

Re: [R] Antwort: RE: Interdependencies of variable types, logical expressions and NA

2016-04-28 Thread PIKAL Petr
Hi your initial ds > str(ds) 'data.frame': 2 obs. of 3 variables: $ var1: num 1 1 $ var2: logi TRUE FALSE $ var3: logi NA NA first result > str(ds) 'data.frame': 2 obs. of 6 variables: $ var1 : num 1 1 $ var2 : logi TRUE FALSE $ var3 : logi

Re: [R] Interdependencies of variable types, logical expressions and NA

2016-04-28 Thread PIKAL Petr
Sorry these T = T (you can decide that regardless value in NA the result must be T) F = NA (you cannot decide hence NA) should be T | NA = T (you can decide that regardless value in NA the result must be T) F | NA = NA (you cannot decide hence NA) Cheers Petr > -Original Message- >

Re: [R] Interdependencies of variable types, logical expressions and NA

2016-04-28 Thread PIKAL Petr
Hi Your script is not reproducible. Creating Check_U_0__Kd_1_2011 from Umsatz_2011 and Kunde01_2011 Error in ifelse(Kunden01[[Umsatz]] == 0 & Kunden01[[Kunde]] == 1, 1, 0) : object 'Kunden01' not found > This is interesting x <- c(NA, FALSE, TRUE) names(x) <- as.character(x) outer(x, x, "&")

[R] Interdependencies of variable types, logical expressions and NA

2016-04-28 Thread G . Maubach
Hi All, my script tries to do the following on factors: > ## Check for case 3: Umsatz = 0 & Kunde = 1 > for (year in 2011:2015) { + Umsatz <- paste0("Umsatz_", year) + Kunde <- paste0("Kunde01_", year) + Check <- paste0("Check_U_0__Kd_1_", year) + + cat('Creating', Check, 'from',