Re: [R] [FORGED] Re: Block comment?

2017-09-02 Thread Rolf Turner
On 03/09/17 12:29, Duncan Murdoch wrote: On 02/09/2017 6:57 PM, Rolf Turner wrote: On 03/09/17 03:56, William Dunlap via R-help wrote: Is the reason you want a block comment containing code (as opposed to arbitrary text) that you want to be able to easily run the commented out code? If so

Re: [R] [FORGED] Re: Block comment?

2017-09-02 Thread Duncan Murdoch
On 02/09/2017 6:57 PM, Rolf Turner wrote: On 03/09/17 03:56, William Dunlap via R-help wrote: Is the reason you want a block comment containing code (as opposed to arbitrary text) that you want to be able to easily run the commented out code? If so the 'if()' construct has the advantage that

Re: [R] [FORGED] Re: Block comment?

2017-09-02 Thread Rolf Turner
On 03/09/17 03:56, William Dunlap via R-help wrote: Is the reason you want a block comment containing code (as opposed to arbitrary text) that you want to be able to easily run the commented out code? If so the 'if()' construct has the advantage that you only need to change code at the start of

[R] problem in testing data with e1071 package (SVM Multiclass)

2017-09-02 Thread stefania.pec...@univ-ubs.fr
Hello all, this is the first time I'm using R and e1071 package and SVM multiclass (and I'm not a statistician)! I'm very confused, then. The goal is: I have a sentence with sunny; it will be classified as "yes" sentence; I have a sentence with cloud, it will be classified as "maybe"; I have a

Re: [R] Precision error in time index of ts objects

2017-09-02 Thread Achim Zeileis
On Sat, 2 Sep 2017, Andrea Altomani wrote: Thanks for the very detailed explanation. I did not create the series using structure(), that was the result of dump() on an intermediate object created within tsdisagg::ta(), There is no tsdisagg package on CRAN, just tsdisagg2. But this does not

Re: [R] Strange lazy evaluation of default arguments

2017-09-02 Thread Bert Gunter
This is exactly as expected. See section 4.3.3 of the R Language definition or google around on "R Lazy Evaluation" for details. You should not "expect" R's semantics to be the same as other languages with which you may be familiar. Spending time with a good tutorial or two should help you sort

Re: [R-es] Consejo

2017-09-02 Thread Carlos Ortega
Basados en R hay alguno: https://www.amazon.es/Complex-Surveys-Analysis-Survey-Methodology/dp/0470284307/ref=sr_1_2?ie=UTF8=1504376183=8-2=survey+with+R Mira en cualquier caso las referencias, bibliografía, artículos que suelen aparecer en la ayuda de cada paquete. También esta referencia te

Re: [R] Strange lazy evaluation of default arguments

2017-09-02 Thread Jeff Newmiller
Yes, this is intended behavior, and it has everything to do with where the parameters are first referenced and nothing to do with debugging. -- Sent from my phone. Please excuse my brevity. On September 2, 2017 10:22:22 AM PDT, Matthias Gondan wrote: >Dear R

Re: [R] Strange lazy evaluation of default arguments

2017-09-02 Thread Matthias Gondan
Dear Bill, All makes perfect sense (including the late evaluation). I actually discovered the problem by looking at old code which used your proposed solution. Still I find it strange (and, hnestly, I don’t like R’s behavior in this respect), and I am wondering why u is not being copied to L

Re: [R] Strange lazy evaluation of default arguments

2017-09-02 Thread William Dunlap via R-help
Another way to avoid the problem is to not redefine variables that are arguments. E.g., > Su3 <- function(u=100, l=u, mu=0.53, sigma2=4.3^2, verbose) { if (verbose) { print(c(u, l, mu)) } uNormalized <- u/sqrt(sigma2) lNormalized <- l/sqrt(sigma2) muNormalized <-

Re: [R] Strange lazy evaluation of default arguments

2017-09-02 Thread ruipbarradas
Hello, One way of preventing that is to use ?force. Just put force(l) right after the commented out print and before you change 'u'. Hope this helps, Rui Barradas Citando Matthias Gondan : Dear R developers, sessionInfo() below Please have a look at the

[R] Strange lazy evaluation of default arguments

2017-09-02 Thread Matthias Gondan
Dear R developers, sessionInfo() below Please have a look at the following two versions of the same function: 1. Intended behavior: > Su1 = function(u=100, l=u, mu=0.53, sigma2=4.3^2) + { + print(c(u, l, mu)) # here, l is set to u’s value + u = u/sqrt(sigma2) + l = l/sqrt(sigma2) + mu

Re: [R-es] Consejo

2017-09-02 Thread Antonio Rodriguez Andres
Muchas gracias, me recomienda algunos libros para comenzar. Saludos El 2/09/2017 3:16 p. m., "Javier Marcuzzi" escribió: > Estimado Antonio Rodriguez Andres > > > > Comienza por donde quieras, lee un libro general, luego otro sobre un tema > específico, realiza

Re: [R] Block comment?

2017-09-02 Thread William Dunlap via R-help
Is the reason you want a block comment containing code (as opposed to arbitrary text) that you want to be able to easily run the commented out code? If so the 'if()' construct has the advantage that you only need to change code at the start of the comment, not at both ends. The if(FALSE) could

Re: [R] Block comment?

2017-09-02 Thread Jeff Newmiller
I agree, since one reason for block commenting is to include syntactically-invalid information (such as broken code) in the source code. However, block commenting is not wholly a good thing, as both the R parser and human coders often find it challenging to identify where the end of the block

Re: [R] Block comment?

2017-09-02 Thread Bert Gunter
Uwe showed an R code -ish way to do it. RStudio and probably other R UI's and IDE's -- which is the way most folks write code, I think -- also make it easy to do. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." --

Re: [R] Block comment?

2017-09-02 Thread Suzen, Mehmet
AFAIK block comment is not possible it needs to be implemented in R interpreter and defined in the parser.'If' solution is not elegant. On 2 September 2017 at 14:09, Uwe Ligges wrote: > > > On 02.09.2017 11:40, Christian wrote: >> >> I consider it quite worth

Re: [R-es] Consejo

2017-09-02 Thread Carlos Ortega
Y hasta hay una "Task View" donde se agrupan y detallan los diferentes paquetes para encuestas: CRAN Task View: Official Statistics & Survey Methodology https://cloud.r-project.org/web/views/OfficialStatistics.html Saludos, Carlos Ortega www.qualityexcellence.es 2017-09-02 15:25 GMT+02:00

Re: [R-es] Consejo

2017-09-02 Thread Carlos Ortega
Hola, Hay múltiples paquetes en R que permiten trabajar con encuestas, desde diseñarlas hasta analizar resultados: memisc: Tools for Management of Survey Data and the Presentation of Analysis Results https://cloud.r-project.org/web/packages/memisc/index.html

Re: [R-es] Consejo

2017-09-02 Thread Javier Marcuzzi
Estimado Antonio Rodriguez Andres Comienza por donde quieras, lee un libro general, luego otro sobre un tema específico, realiza muchos ejercicios, y luego intente manejar muchos datos, de lo contrario quedará enredado con los datos propios y las distintas alternativas que tiene R para el

Re: [R] How to use getSymbols() to get annual data

2017-09-02 Thread Duncan Murdoch
On 01/09/2017 7:37 PM, Yingrui Liu wrote: Dear Sir/Madam, How to use getSymbols() to get annual data? For example, I need the annual stock price of APPLE from the year 2000 to 2016. How to write the command? I only know how to get the daily data. It is:

Re: [R] Block comment?

2017-09-02 Thread Uwe Ligges
On 02.09.2017 11:40, Christian wrote: I consider it quite worth while to introduce into R syntax a nestable block comment like #{ }# if(FALSE){ } Best, Uwe Ligges It would make documentation more easily manageable and lucid. Is there considerable need for this. Please, comment on

Re: [R] Precision error in time index of ts objects

2017-09-02 Thread Andrea Altomani
Thanks for the very detailed explanation. I did not create the series using structure(), that was the result of dump() on an intermediate object created within tsdisagg::ta(), which is where I found the error in the first place. ta() indeed manipulates .Tsp directly, rather than using ts. I guess

Re: [R] correlation between nominal and ordinal

2017-09-02 Thread Jim Lemon
hi merlin, Check out the hetcor package. Jim On Sat, Sep 2, 2017 at 6:25 AM, wrote: > I would be very grateful if you would tell me how I can find the degree of > correlation between a nominal dependent variable and an independent ordinal > variable. The nominal

[R] Block comment?

2017-09-02 Thread Christian
I consider it quite worth while to introduce into R syntax a nestable block comment like #{ }# It would make documentation more easily manageable and lucid. Is there considerable need for this. Please, comment on this. How about R core? Christian -- Christian Hoffmann Rigiblickstrasse 15b