Re: [R] Maximum length for a -e argument to Rscript?

2017-04-21 Thread Ben Haller
OK, thanks for the information Ben and Henrik. It sounds like even if the Rscript stall were fixed, there would still be a 10k limit when using -e, as well as a 4K maximum line length limit when using -e or stdin, if I understand the section cited by Ben; so I need to switch to using a

[R] CRAN and Github: Licensing Issues

2017-04-21 Thread Richard Barnes
I have an R package who's code I'd like to keep on Github. In accordance with R's requirements (see here for a note about template licenses), I have in my DESCRIPTION file the line: > License: MIT + file LICENCE And my LICENCE file contains the MIT template, as required: > YEAR: 2017 > COPYRIGHT

[R] GLMM for Combined experiments and overdispersed data

2017-04-21 Thread Juan Pablo Edwards Molina
I am analyzing data from 3 field experiments (farms=3) for a citrus flower disease: response variable is binomial because the flower can only be diseased or healthy. I have particular interest in comparing 5 fungicide spraying systems (trt=5). Each farm had 4 blocks (bk=4) including 2 trees as

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Hervé Pagès
On 04/21/2017 02:03 PM, (Ted Harding) wrote: I've been following this thread with interest. A nice collection of things to watch out for, if you don't want the small arithmetic errors due to finite-length digital representations of fractions to cause trouble! However, as well as these small

Re: [R] Wireframe plot inside a function

2017-04-21 Thread George Trojan - NOAA Federal
But it works ;-). According to print.trellis help, 'plot' is an alias for 'print'. IMO, this is an abuse of overloading: same method name does totally different things. On 21 April 2017 at 21:58, Jeff Newmiller wrote: > No... it is > > print(plot(cop1, main = "cop1

Re: [R] Maximum length for a -e argument to Rscript?

2017-04-21 Thread Henrik Bengtsson
That Rscript stalls sounds like a bug, but not sure it's R or the terminal that needs to be fixed: Rscript -e "$long_expression" WARNING: '-e

Re: [R] Wireframe plot inside a function

2017-04-21 Thread Jeff Newmiller
No... it is print(plot(cop1, main = "cop1 function")) -- Sent from my phone. Please excuse my brevity. On April 21, 2017 1:56:00 PM PDT, George Trojan - NOAA Federal wrote: >I see. So, if I don't care about the plot object itself, the proper >incantation is >

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread BR_email
David: Its' not going my way today. I'll try to work with all that you provided. It's late Friday and I cannot impose on you much more. Thank you. If I may, after I rework it, I'll contact you, okay? Have great weekend. And thanks, again. Bruce FYI: Below are where the error messages start: R>

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Ted Harding
I've been following this thread with interest. A nice collection of things to watch out for, if you don't want the small arithmetic errors due to finite-length digital representations of fractions to cause trouble! However, as well as these small discrepancies, major malfunctions can also result.

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread David L Carlson
I've attached a modification of your script file (called .txt so it doesn't get stripped). See if this does what you want. David C -Original Message- From: Bruce Ratner PhD [mailto:b...@dmstat1.com] Sent: Friday, April 21, 2017 3:46 PM To: David L Carlson Cc:

Re: [R] Wireframe plot inside a function

2017-04-21 Thread George Trojan - NOAA Federal
I see. So, if I don't care about the plot object itself, the proper incantation is plot(plot(cop1, main = "cop1 function")) Thanks again. On 21 April 2017 at 20:32, Jeff Newmiller wrote: > Your original function created the cop1 plot object but did nothing with it.

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread Bruce Ratner PhD
David: Correction: I do need a data frame because from the order Response column I create a data frame as per all my calculated columns, yielding the five column decile table. I used your latest corrections but something buggy is a happenin'. Bruce __ Bruce Ratner PhD The

Re: [R] Wireframe plot inside a function

2017-04-21 Thread Jeff Newmiller
Your original function created the cop1 plot object but did nothing with it. It then created the cop2 plot and returned it from the function. Since you had invoked the cplot function from the interactive console, R printed that returned object automatically, which displayed the plot. FYI:

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread Bruce Ratner PhD
David: Response=rbinom(50,1,0.2), and yhat=runif(50) are simulating the output of a say logistic model, where Response is actual 0-1 responses, and yhat is the predicted response variable. I usually resample the original data to get some noise out of the data. I find it valuable if I can

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread David L Carlson
You have an issue at the top with Resp <- data.frame(Response=rbinom(50,1,0.2), yhat=runif(50)) Resp <- Resp[order(Response$yhat,decreasing=TRUE),] Since Response$yhat has not been defined at this point. Presumably you want Resp <- Resp[order(Resp$yhat,decreasing=TRUE),] The main issue is that

Re: [R] Wireframe plot inside a function

2017-04-21 Thread George Trojan - NOAA Federal
Thanks. After changing the function to cplot <- function(cop1, cop2) { x11() o <- plot(cop1, main = "cop1 function") print(o) x11() o <- plot(cop2, main = "cop2 function") print(o) } I see both plots. But, since "cop2 function" was plotted before, does it mean it is plotted twice

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread BR_email
David: I tried somethings and got a little more working. Now, I am struck at last line provided: "dec_mean<- aggregate(Response ~ decc, dd, mean)" Any help is appreciated. Bruce * Resp <- data.frame(Response=rbinom(50,1,0.2), yhat=runif(50)) Resp <-

Re: [R] Maximum length for a -e argument to Rscript?

2017-04-21 Thread Ben Tupper
Hi, I suspect you are over the 10kb limit for the expression. See https://cran.r-project.org/doc/manuals/r-release/R-intro.html#Invoking-R-from-the-command-line Cheers, Ben > On Apr 21, 2017, at 3:44 AM, Ben Haller wrote: > > Hi! I’m attempting to use Rscript to do some

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread Bert Gunter
?? Works for me. Perhaps show us the output of sessionInfo(). Mine is: R version 3.3.3 (2017-03-06) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12.3 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread BR_email
David: Hate to bother you, but because you have seen my code perhaps you can tell me what I am doing wrong. I want to replicate my original Response data by 0 times, called ResponseX10. All is good until the first calculation, cum_R. Would you kindly, assist me? Thanks. Bruce Response <-

[R] [R-pkgs] New package: fastDummies

2017-04-21 Thread Jacob Kaplan
Dear R users, I am happy to announce that the package fastDummies is now on CRAN (*https://cran.r-project.org/package=fastDummies )*. The fastDummies package lets you quickly and easily create dummy columns from categorical variables in data.tables

Re: [R] Peformance question

2017-04-21 Thread Thomas Mailund
I did try to profile it but I'll throw some more experiments at it. Right now I suspect it is mostly a problem of wrapping the data in objects which I do more for the purely functional version than the other two, but I'll experiment some more Cheers Thomas On 21 Apr 2017, 13.20 +0200, Paul

[R] Maximum length for a -e argument to Rscript?

2017-04-21 Thread Ben Haller
Hi! I’m attempting to use Rscript to do some automated plotting. It is working well, except that I seem to be running into a maximum line length issue, and I’m wondering if it is a bug on your end. Here’s an example of the command I’m trying to run: /usr/local/bin/Rscript -e '{x <-

[R] 回复:RE: by function error

2017-04-21 Thread 苏文龙
I got it; thanks -- BestRegards Su Wenlong Phone:13408010439 -- 原始邮件 -- 发件人: "PIKAL Petr";; 发送时间: 2017年4月21日(星期五) 凌晨0:16 收件人: "苏文龙"<814057...@qq.com>; "r-help"; 主题: RE: [R] by function

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread JRG
A good part of the problem in the specific case you initially presented is that some non-integer numbers have an exact representation in the binary floating point arithmetic being used. Basically, if the fractional part is of the form 1/2^k for some integer k > 0, there is an exact representation

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Hervé Pagès
On 04/21/2017 05:19 AM, Paul Johnson wrote: We all agree it is a problem with digital computing, not unique to R. I don't think that is the right place to stop. What to do? The round example arose in a real funded project where 2 R programs differed in results and cause was that one person got

Re: [R] Wireframe plot inside a function

2017-04-21 Thread Jeff Newmiller
FAQ 7.22 And don't send HTML email... you are the one making it difficult for us to read your question. -- Sent from my phone. Please excuse my brevity. On April 21, 2017 8:27:20 AM PDT, George Trojan - NOAA Federal wrote: >Consider the following example: >

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Jeff Newmiller
Your guideline #1 is invalid for R... compare 5L/3L to 5L %/% 3L. If you want to avoid automatic conversion to double then you have to be cautious which operators/functions you apply to them... merely throwing in L everywhere is not going to help. #2 refers to S3, but that is a completely

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread George Trojan - NOAA Federal
The subject is messy. I vaguely remember learning this stuff on my first numerical analysis course over 40 years ago. The classic reference material (much newer, only 25 years old) is: What Every Computer Scientist Should Know About Floating-Point Arithmetic, David Goldberg, ACM Computing Surveys,

[R] Wireframe plot inside a function

2017-04-21 Thread George Trojan - NOAA Federal
Consider the following example: library("kdecopula") library("mvtnorm") pobs <- function(x) rank(x) / (length(x) + 1) n <- 1000 sigma1 <- diag(x = 1, 2, 2) x1 <- rmvnorm(n, sigma = sigma1) xx1 <- apply(x1, 2, pobs) cop1 <- kdecop(xx1) eps <- 0.8 sigma2 <- matrix(c(1, eps, eps, 1), ncol = 2)

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Bert Gunter
I suggest you read some basic books on numerical analysis and/or talk with a numerical analyst. You are (like most of us) an amateur at this sort of thing trying to reinvent wheels. If you are concerned with details, talk with experts. Don't assume what you don't know. This list is *not* a

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread Bruce Ratner PhD
David: Got it! Thanks, again. Bruce __ Bruce Ratner PhD The Significant Statistician™ (516) 791-3544 Statistical Predictive Analytics -- www.DMSTAT1.com Machine-Learning Data Mining -- www.GenIQ.net > On Apr 21, 2017, at 10:56 AM, David L Carlson wrote: > >

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread David L Carlson
You can rename the columns with colnames() before passing it to xtable. This will let you use characters that data.frame would automatically convert. I don't see an easy way to center the columns when printing an html file. If you are not making too many of these, you could open the .html file

[R] R 3.4.0 is released

2017-04-21 Thread Peter Dalgaard
The build system rolled up R-3.4.0.tar.gz (codename "You Stupid Darkness") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.4.0.tar.gz or wait for it to be mirrored at a CRAN site nearer to you.

Re: [R] Wilcoxon Test

2017-04-21 Thread Achim Zeileis
On Fri, 21 Apr 2017, peter dalgaard wrote: Also, as far as I know just for historical consistency, the test statistic in R is the rank sum of the first group MINUS its minimum possible value: W = 110.5 - sum(1:13) = 19.5 Ah, yes, I meant to add that remark. And coin::wilcox_test always

Re: [R] Wilcoxon Test

2017-04-21 Thread peter dalgaard
Also, as far as I know just for historical consistency, the test statistic in R is the rank sum of the first group MINUS its minimum possible value: W = 110.5 - sum(1:13) = 19.5 -pd > On 21 Apr 2017, at 14:54 , Achim Zeileis wrote: > > On Fri, 21 Apr 2017, Tripoli

Re: [R] Wilcoxon Test

2017-04-21 Thread Ivan Calandra
Try setting the 'correct' argument to FALSE (similar to CORRECT=NO option in the SAS documentation). The p-values are then identical, although the W values are different. Additionally I cannot understand why you get a warning from R that it cannot compute exact p-values because of ties, while

Re: [R] Wilcoxon Test

2017-04-21 Thread Achim Zeileis
On Fri, 21 Apr 2017, Tripoli Massimiliano wrote: Dear R users, Why the result of Wilcoxon sum rank test by R is different from sas https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_npar1way_sect022.htm The code is next: sampleA <- c(1.94, 1.94, 2.92,

[R] Wilcoxon Test

2017-04-21 Thread Tripoli Massimiliano
Dear R users, Why the result of Wilcoxon sum rank test by R is different from sas https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_npar1way_sect022.htm The code is next: sampleA <- c(1.94, 1.94, 2.92, 2.92, 2.92, 2.92, 3.27, 3.27, 3.27, 3.27,

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Paul Johnson
We all agree it is a problem with digital computing, not unique to R. I don't think that is the right place to stop. What to do? The round example arose in a real funded project where 2 R programs differed in results and cause was that one person got 57 and another got 58. The explanation was

Re: [R] Multiple Histograms in R

2017-04-21 Thread Gerrit Draisma
Prateek, Does lattice do what you want? HTH Gerrit ppdat<-read.table(text="mou_mean,totalmrc_mean,rev_range,mou_range,Churn 23,24,25,27,1 45,46,47,49,1 43,44,45,47,1 45,46,47,49,0 56,57,58,60,0 67,68,69,71,1 67,68,69,71,0 44,45,46,48,1 33,34,35,37,0 90,91,92,94,1 87,88,89,91,1 76,77,78,80,1

Re: [R] Peformance question

2017-04-21 Thread Paul Johnson
I dont understand your code. But I do have suggestion. Run the functions in the profiler, maybe differences will point at the enemy. Know what I mean? Rprof('check.out') #run code Rprof(NULL) summaryRprof('check.out') Do that for each method. That may be uninformative. I wondered if you tried

[R-es] Shiny problemas con updateSelectInput

2017-04-21 Thread José Luis Cañadas
Buenas a todos. Os cuento mi problema. Tengo un documento rmd interactivo, con shiny y quiero que un selectinput se actualice según lo seleccionado en otro selectInput. En realidad lo que quiero con el primer selectInput es seleccionar un data.frame de una lista de data.frame, y que se actulaice

Re: [R] Prediction plots

2017-04-21 Thread Paul Johnson
I have done this a lot. Would you mind installing my pkg rockchalk and then run example(plotSlope) and example(plotCurve)? If the output is close to what you want, you can adjust my code. The vignette explains. 1. Create newdata object 2. Run that through predict 3. Make plot None of this is

Re: [R] Looking for a package to replace xtable

2017-04-21 Thread Bruce Ratner PhD
Thanks, Jeff. Bruce __ Bruce Ratner PhD The Significant Statistician™ (516) 791-3544 Statistical Predictive Analytics -- www.DMSTAT1.com Machine-Learning Data Mining -- www.GenIQ.net > On Apr 20, 2017, at 7:15 PM, Jeff Newmiller wrote: > > ReportR