similar to: A trap for young players with the lapply() function.

Displaying 20 results from an estimated 1000 matches similar to: "A trap for young players with the lapply() function."

2017 Mar 29
1
A trap for young players with the lapply() function.
(inline) On Tue, 28 Mar 2017, Rolf Turner writes: > On 28/03/17 04:21, Barry Rowlingson wrote: >> On Mon, Mar 27, 2017 at 1:17 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote: >>> >>> Is there any way to trap/detect the use of an optional argument called >>> "X" and thereby issue a more perspicuous error message? >>> >>>
2017 Mar 27
0
A trap for young players with the lapply() function.
On 28/03/17 04:21, Barry Rowlingson wrote: > On Mon, Mar 27, 2017 at 1:17 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote: >> >> Is there any way to trap/detect the use of an optional argument called >> "X" and thereby issue a more perspicuous error message? >> >> This would be helpful to those users who, like myself, are bears of very >>
2017 Mar 27
2
A trap for young players with the lapply() function.
From time to time I get myself into a state of bewilderment when using apply() by calling it with FUN equal to a function which has an "optional" argument named "X". E.g. xxx <- lapply(y,function(x,X){cos(x*X)},X=2*pi) which produces the error message > Error in get(as.character(FUN), mode = "function", envir = envir) : > object 'y' of
2017 Mar 28
0
A trap for young players with the lapply() function.
>I think that the suggestion I made, in response to a posting by Barry >Rowlingson, that the first argument of lapply() be given the name of ".X" rather >than just-plain-X, would be (a) effective, and (b) harmless. It would break any call to *apply() that used X= to name the first argument. There are currently 3020 such calls in the R code in CRAN. One can avoid the problem
2017 Mar 28
2
A trap for young players with the lapply() function.
On 28/03/17 15:26, Charles C. Berry wrote: > On Mon, 27 Mar 2017, Rolf Turner wrote: > >> >> From time to time I get myself into a state of bewilderment when using >> apply() by calling it with FUN equal to a function which has an >> "optional" argument named "X". >> >> E.g. >> >> xxx <-
2017 Jun 07
2
purrr::pmap does not work
Hi All, I try to do a scatterplot for a bunch of variables. I plot a dependent variable against a bunch of independent variables: -- cut -- graphics::plot( v01_r01 ~ v08_01_up11, data = dataset, xlab = "Dependent", ylab = "Independent #1" ) -- cut -- It is tedious to repeat the statement for all independent variables. Found an alternative, i.e. : -- cut -- mu
2017 Dec 08
1
lmerTest Issues
Hello all, Everything was working very well. Now when I try to load lmerTest using: library("lmerTest"), I get this error: Error: package or namespace load failed for ?lmerTest? in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ?purrr? Nothing I've done has worked. I have uninstalled both R and R studio. I've
2017 Aug 14
2
tidyverse repeating error: "object 'rlang_mut_env_parent' not found"
Thanks for the feedback Jeff. Before I pursue a bug report, let me give a full example: ###### begin console output R version 3.4.1 (2017-06-30) -- "Single Candle" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions.
2017 Aug 14
0
tidyverse repeating error: "object 'rlang_mut_env_parent' not found"
> On Aug 14, 2017, at 8:37 AM, Szumiloski, John <John.Szumiloski at bms.com> wrote: > > Thanks for the feedback Jeff. Before I pursue a bug report, let me give a full example: > > ###### begin console output > > R version 3.4.1 (2017-06-30) -- "Single Candle" > Copyright (C) 2017 The R Foundation for Statistical Computing > Platform:
2023 Mar 19
1
WISH: Optional mechanism preventing var <<- value from assigning non-existing variable
I'd like to be able to prevent the <<- assignment operator ("super assignment") from assigning to the global environment unless the variable already exists and is not locked. If it does not exist or is locked, I'd like an error to be produced. This would allow me to evaluate expressions with this temporarily set to protect against mistakes. For example, I'd like to
2023 Mar 19
1
WISH: Optional mechanism preventing var <<- value from assigning non-existing variable
I think that should be the default behaviour. It's pretty late to get that into R 4.3.0, but I think your proposal (with check.superassignment = FALSE being the default) could make it in, and 4.4.0 could change the default to TRUE. Duncan On 19/03/2023 12:08 p.m., Henrik Bengtsson wrote: > I'd like to be able to prevent the <<- assignment operator ("super >
2020 Apr 16
2
suggestion: "." in [lsv]apply()
I'm sure this exists elsewhere, but, as a trade-off, could you achieve what you want with a separate helper function F(expr) that constructs the function you want to pass to [lsv]apply()? Something that would allow you to write: sapply(split(mtcars, mtcars$cyl), F(summary(lm(mpg ~ wt,.))$r.squared)) Such an F() function would apply elsewhere too. /Henrik On Thu, Apr 16, 2020 at 9:30 AM
2023 Mar 19
2
WISH: Optional mechanism preventing var <<- value from assigning non-existing variable
Why should it make an exception for cases where the about-to-be-assigned-to name is present in the global environment? I think it should warn or give an error if the altered variable is in any environment on the search list. -Bill On Sun, Mar 19, 2023 at 10:54?AM Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > I think that should be the default behaviour. It's pretty late to
2017 Nov 22
2
Tibble o data.table?
Buenas Os queria preguntar que ventaja le veis a las tibbles frente a los data.table, ya que para mi, quitando el uso de librerias como tidyr o purrr, en el resto prefiero usar data.table. Me parece igual de potente y mucho más rápido, y no le veo las supuestas ventajas, pero quiero conocer vuestra opinion. Gracias Jesús [[alternative HTML version deleted]]
2017 Jun 08
2
add_model paquete modeval
Estimados compañeros me gustaría saber si alguno ha utilizado la función add_model del paquete modeval cuando la variable de clasificación (y) tiene más de dos niveles. Porque si la utilizo con más niveles siempre me sale el error: Error: length(levels(factor((purrr::as_vector(y))))) == 2 is not TRUE Me parece muy interesante el paquete y no veo donde indica esta limitación. Un cordial
2017 Aug 17
2
How to install Tidyverse on Ubuntu 17.04? Getting gcc errors for -fstack-protector-strong and -Wdate-time
I'm running Ubuntu 17.04 and R 3.4.1. I installed the latter yesterday, so I presume it's the latest version. I want to install Tidyverse, which I've spent many happy hours with under Windows. But when I do install.packages("tidyverse") , I get errors about unrecognized command line options to gcc. These start when the install hits the colorspace and munsell packages.
2019 Jul 21
1
Recommended Reading: Advanced R Second Edition
Dear R Developers, After having fully read "Advanced R First Edition" , and having just bought my physical copy of "Advanced R Second Edition", I recommend that: Any community member interested in the development of R reads "Advanced R Second Edition", which explains R Language Core concepts cristal clear, and shows the motivation behind libraries such as
2023 Mar 19
1
WISH: Optional mechanism preventing var <<- value from assigning non-existing variable
I have to say <<- is a core debugging tool when assigning into the global environment. I suppose I could use assign but that would be somewhat annoying. That said I'm still for this change, the vast overwhelming number of times that <<- is in my package code - already rare but it does happen - it would absolutely be a bug (typo most likely) for it to get to the global environment
2020 Oct 04
0
how to get a numeric vector?
Always hard to tell if THIS is a homework project. As with most things in R, if you can not find at least a dozen ways to do it, it is not worth doing. The question (way below) was how to take two vectors of length two and make a longer results based on using the ":" operator to generate a range between the first element of each array and then between the second elements and return the
2023 Apr 09
1
can't install nser...
Dear members, I can't install "nser" package. It is not in cran but install_version and install_github both are not working: > install_version("nser",version = "1.4.0") Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/nser/nser_1.4.0.tar.gz These packages have more recent versions available. It is