Re: [Rd] Testing for vectors

2018-07-07 Thread Ott Toomet
Thanks, Hadley for bringing this up:-) I am teaching R and I can suggest 5 different definitions of 'vector': a) vector as a collection of homogeneous objects, indexed by [ ] (more precisely atomic vector). Sometimes you hear that in R, "everything is a vector", but this is only true for atomic

Re: [Rd] Testing for vectors

2018-07-07 Thread Ott Toomet
Gabe, I agree that If by standard you mean commonly used/understood, though, I doubt > most R users would understand a list to be a vector. I think most people > think of atomic vectors exclusively when they hear "vector" unless they've > very specifically been trained not to do so. However, a c

Re: [Rd] R-Forge > GitHub?

2019-06-28 Thread Ott Toomet
Apparently your username/password are wrong. Can you clone/push from other repos? You do not need authorization when cloning a public repo, so even incorrect credentials may work (haven't tested this though). But for push you have to have that in order. I suggest you create ssh keys, upload tho

Re: [Rd] R-Forge > GitHub?

2019-06-30 Thread Ott Toomet
t; place later. > >>>> > >>>> After you got the above in place, then .travis.yml and appveyor.yml is > >>>> pretty straightforward (might even be a copy'n'paste). > >>>> > >>>> Finally, I saw you put your credentials in

[Rd] sequence divided by data.frame

2015-08-20 Thread Ott Toomet
Can anyone explain me the following behavior: > 1:2/1 [1] 1 2 -- makes sense > 1:2/matrix(1,1,1) [1] 1 2 -- makes sense > 1:2/data.frame(a=1) a 1 1 -- why is this different? Best, Ott -- Ott Toomet Visiting Researcher School of Information Mary Gates Hall, Suite 095 Univ

Re: [Rd] issues with dev.new avoiding RStudio plot device on unix?

2015-09-25 Thread Ott Toomet
a little strange logically. > > > best, > -skye > > p.s. I wonder if instead of having a noRStudioGD=TRUE flag, it might be a > more future-proof design to have an avoid.devices='RStudioGD' argument in > case users need to induce similar behavior to avoid othe

[Rd] row names of 'rowsum()'

2016-09-15 Thread Ott Toomet
'rowsum()' seems to add row names to the resulting matrix, corresponding to the respective 'group' values. This is very handy, but it is not documented. Should the documentation mention it so it could be relied upon as part of API? Cheers, Ott -- Ott Toomet Visiting

Re: [Rd] row names of 'rowsum()'

2016-09-19 Thread Ott Toomet
I am referring to base::rowsum(), not rowSums(). For some reason I cannot access it's help on my computer but the online documentation (R-devel version) states: Value A matrix or data frame containing the sums. There will be one row per unique value of group Period. Above, the argument 'reorder

[Rd] as.character.factor and S4 object containing factor

2016-09-22 Thread Ott Toomet
methods... platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 3 minor 3.1 year 2016 month 06 day21 svn rev 70800 language R version.string R version 3.3.1 (2016-

[Rd] hist(..., log="y")

2023-08-05 Thread Ott Toomet
Sorry if this topic has been discussed earlier. Currently, hist(..., log="y") fails with > hist(rexp(1000, 1), log="y") Warning messages: 1: In plot.window(xlim, ylim, "", ...) : nonfinite axis=2 limits [GScale(-inf,2.59218,..); log=TRUE] -- corrected now 2: In title(main = main, sub = sub, xla

Re: [Rd] feature request: optim() iteration of functions that return multiple values

2023-08-06 Thread Ott Toomet
I have done this using attributes: fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] ans <- 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 attr(ans, "extra1") <- 1:10 attr(ans, "extra2") <- letters ans } Not sure if this works in your case though. Cheers, Ott On S