Displaying 20 results from an estimated 9000 matches similar to: "Improved Data Aggregation and Summary Statistics in R"
2019 Feb 27
0
Improved Data Aggregation and Summary Statistics in R
Dear Sebastian,
Initially I was a bit hesitant to think about yet another way to summarize
data, but your illustrations convinced me this is actually a great addition
to the toolset currently available in different R packages. Many of us have
written custom functions to get the required tables for specific data sets,
but this would reduce that effort to simply using the right collap() call.
Like
2019 Feb 27
0
Improved Data Aggregation and Summary Statistics in R
On 26/02/2019 8:25 a.m., Sebastian Martin Krantz wrote:
> Dear Developers,
>
> Having spent time developing and thinking about how data aggregation and
> summary statistics can be enhanced in R, I would like to present my
> ideas/efforts in the form of two commands:
>
> The first, which for now I called 'collap', is an upgrade of aggregate that
> accommodates and
2023 Mar 12
2
Multiple Assignment built into the R Interpreter?
Thanks Gabriel and Kevin for your inputs,
regarding your points Gabriel, I think Python and Julia do allow multiple
sub-assignment, but in-line with my earlier suggestion in response to
Duncan to make multiple assignment an environment-level operation (like
collapse::%=% currently works), this would not be possible in R.
Regarding the [a] <- coolest_function() syntax, yeah it would mean do
2023 Mar 12
1
Multiple Assignment built into the R Interpreter?
On 12/03/2023 6:07 a.m., Sebastian Martin Krantz wrote:
> Thinking more about this, and seeing Kevins examples at
> https://github.com/kevinushey/dotty
> <https://github.com/kevinushey/dotty>, I think this is the most R-like
> way of doing it,
> with an additional benefit as it would allow to introduce the useful
> data.table semantics DT[, .(a = b, c, d)] to more
2023 Mar 12
1
Multiple Assignment built into the R Interpreter?
Kevins package is very nice as a proof of concept, no doubt about that, but
it is not at the level of performance or convenience that a native R
implementation would offer. I would probably not use it to translate matlab
routines into R packages placed on CRAN, because it?s an additional
dependency, I have a performance burden in every iteration, and
utils::globalVariables() is everything but
2023 Mar 13
1
Multiple Assignment built into the R Interpreter?
Dear All,
As a maintainer of large, complex packages, I can think of many places
in which deconstructing assignment would simplify the code, as well as
facilitate readability by breaking up larger functions into helpers, so
I would be very glad to see this incorporated somehow.
I think the crux of the matter is that while there is a number of ways
to implement deconstructing assignment within R,
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
There are some other considerations too (apologies if these were mentioned
above and I missed them). Also below are initial thoughts, so apologies for
any mistakes or oversights.
For example, if
[a, b] <- my2valuefun()
works the same as
local({
tmp <- my2valuefun()
stopifnot(is.list(tmp) && length(tmp) == 2)
a <<- tmp[[1]]
b <<- tmp[[2]]
})
Do we expect
[a[1], b[3]]
2023 Mar 13
1
Multiple Assignment built into the R Interpreter?
Yes, this is really a problem with the checks, not with the language.
A simpler approach than your alternativeAssignment function would be
simply to allow globalVariables() to be limited to a single function as
the note in its help page says.
This might be tedious to write by hand, but could be automated using
methods like "dotify" in dotty.
Duncan Murdoch
On 12/03/2023 10:36
2023 Mar 11
3
Multiple Assignment built into the R Interpreter?
Dear R Core,
working on my dynamic factor modelling package, which requires several
subroutines to create and update several system matrices, I come back to
the issue of being annoyed by R not supporting multiple assignment out of
the box like Matlab, Python and julia. e.g. something like
A, C, Q, R = init_matrices(X, Y, Z)
would be a great addition to the language. I know there are several
2023 Mar 11
3
Multiple Assignment built into the R Interpreter?
Thanks Duncan and Ivan for the careful thoughts. I'm not sure I can follow
all aspects you raised, but to give my limited take on a few:
> your proposal violates a very basic property of the language, i.e. that all statements are expressions and have a value.
> What's the value of 1 + (A, C = init_matrices()).
I'm not sure I see the point here. I evaluated 1 + (d =
2019 Oct 11
2
New matrix function
I think you are confusing package and function here. Plus some of the R
Core packages, that you mention, contain functions that should probably be
replaced by functions with better implementation from packages on CRAN.
Best regards
Morgan
On Fri, 11 Oct 2019 15:22 Joris Meys, <jorismeys at gmail.com> wrote:
>
>
> On Fri, Oct 11, 2019 at 3:55 PM Morgan Morgan <morgan.emailbox
2018 Jan 31
3
Best practices in developing package: From a single file
On 31/01/2018 6:33 AM, Joris Meys wrote:
> 3. given your criticism, I'd like your opinion on where I can improve
> the documentation of https://github.com/CenterForStatistics-UGent/pim.
> I'm currently busy updating the help files for a next release on CRAN,
> so your input is more than welcome.
After this invitation I sent some private comments to Joris. I would
say his
2018 Sep 18
3
memory footprint of readRDS()
Dear all,
I tried to read in a 3.8Gb RDS file on a computer with 16Gb available
memory. To my astonishment, the memory footprint of R rises quickly to over
13Gb and the attempt ends with an error that says "cannot allocate vector
of size 5.8Gb".
I would expect that 3 times the memory would be enough to read in that
file, but apparently I was wrong. I checked the memory.limit() and that
2018 Apr 24
1
data.table not available as win binary for R 3.5 yet?
Dear all,
to my astonishment data.table cannot be installed on R 3.5 Windows. When
checking the package page, the Windows binary is available for download.
When checking the server however, I can't seem to find data.table. Also
install.packages() says the package is only available in source form and
may need compilation.
Compiling using Rtools 35 is no problem.
Is this merely an issue of
2010 Mar 29
3
one way to write scripts in R
Dear R users,
A colleague of mine asked me how to write a script (an executable text file
containing R code) in R. After I showed
him, he said that after extensive searching of the R archives, he had not
found anything like these techniques.
He suggested that I share these methods to enable others to leverage R as a
better alternative to bash/perl scripts.
So in the interest of giving back to
2018 Jun 09
4
Date class shows Inf as NA; this confuses the use of is.na()
And now I've seen I copied the wrong part of ?is.na
> The default method for is.na applied to an atomic vector returns a
logical vector of the same length as its argument x, containing TRUE for
those elements marked NA or, for numeric or complex vectors, NaN, and FALSE
otherwise.
Key point being "atomic vector" here.
On Sat, Jun 9, 2018 at 1:41 PM, Joris Meys <jorismeys at
2018 Jun 08
2
Date class shows Inf as NA; this confuses the use of is.na()
Indeed. as_date is from lubridate, but the same holds for as.Date.
The output and it's interpretation should be consistent, otherwise it leads
to confusion when programming. I understand that the difference exists
after asking a question on Stack Overflow:
https://stackoverflow.com/q/50766089/914686
This understanding is never mentioned in the documentation - that an Inf
date is actually
2018 May 30
1
CRAN checks give errors when no tests are included
Dear all,
as a follow-up to the question asked on R-package-devel (see link below):
Someone sent a package to CRAN with a few problems. There's more things
wrong with the submission, but one thing that really caught my eye was the
following error:
Warning message:
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD BATCH --vanilla
"testthat.R"
2018 Mar 14
2
truncation/rounding bug with write.csv
I don't see the issue here. It would be helpful if people would report
their sessionInfo() when reporting whether or not they see this issue.
Mine is
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux
Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblas_haswellp-r0.2.20.so
locale:
[1] LC_CTYPE=en_US.UTF-8
2018 Mar 16
2
Apparent bug in behavior of formulas with '-' operator for lm
Joris, the point is that 'z' is NOT used as a predictor in the model.
Therefore it should not affect predictions. Also, I find it suspicious that
the error only occurs when the response variable conitains missings and 'z'
is unique (I have tested several other cases to confirm this).
-Mark
Op vr 16 mrt. 2018 om 13:03 schreef Joris Meys <jorismeys at gmail.com>:
>