[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 University

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

2015-09-25 Thread Ott Toomet
er current or future > devices? Probably to late now tho. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Ott Toomet Visiting Researcher School of Information Mary Gates Hall, Suite 310

[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 Researcher School

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

[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-

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

Re: [Rd] R-Forge > GitHub?

2019-07-01 Thread Ott Toomet
rward (might even be a copy'n'paste). > >>>> > >>>> Finally, I saw you put your credentials in the URL when you cloned. I > >>>> don't think that's safe, your GitHub credentials will be stored in the > >>>> ./.git/config file. Instead, just cl

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

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

2023-08-06 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,

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

Re: [R-pkg-devel] how to make "r-release-osx-x86_64-mavericks" machine support rgl 3D plots

2015-10-08 Thread Ott Toomet
useNULL = TRUE) > > doesn't stop rgl from running, it just stops it from trying to display > anything. So you could put code like > > if (!interactive()) > options(rgl.useNULL = TRUE) > > into your .onLoad function for your package, and it wouldn't try to open > a displa

Re: [R-pkg-devel] openMP/reduction statement causes build crash on travis-ci

2016-08-03 Thread Ott Toomet
x86_64 x86_64 GNU/Linux w/gcc 5.4.0, libgomp1.0.0 > [2] > > https://builder.r-hub.io/status/gower_0.0.1.tar.gz-8c487e92f4af364ee73f85ca8f59775c > [3] https://travis-ci.org/markvanderloo/gower#L619 > > [[alternative HTML version deleted]] > > _______

Re: [R-pkg-devel] winUCRT failures

2021-04-26 Thread Ott Toomet
I think part of the problem is that the corresponding section in "Writing R extensions" is not very clear for newcomers. I admit I have read it several times as I have been confused about the difference between suggest, imports and depends, and so combed section 1.1.3 repeatedly. But from this

Re: [R-pkg-devel] Using the amsmath package in a vignette.

2021-03-03 Thread Ott Toomet
As I read the docs (a few months ago though), you are supposed to include the pdf and encouraged to include sources, but the process to get pdf from source may depend on your private libraries/data/software, and is not replicated on CRAN checks. This seemed to work for me as my vignette includes

[R-pkg-devel] Skipping tests on CRAN

2021-04-20 Thread Ott Toomet
Hi packagers, what is the best way to skip certain tests on CRAN? So far I have included certain test files in .Rbuildignore and run the tests on the package directory. But now when moving to Authors@R format, I get errors about missing maintainer etc. I know there are options in testthat,

Re: [R-pkg-devel] Skipping tests on CRAN

2021-04-21 Thread Ott Toomet
upport") > q("no") > } > > Don't run such code in an interactive session if you don't want to quit > R. ;) > > An alternative is the R CMD check --test-dir=inst/slowTests approach > mentioned in the WRE manual at > > https://CRAN.R-project.org/doc/manu