Coder Social home page Coder Social logo

batman's Issues

extending to other interchangeable things

Dear Oliver,

Based on your suggestion, I am adding the following as a potential suggestion for generalizing batman:

The other common interchangeable things you see on surveys are integers written in english: 1 as "one", 2 as "two" etc.

I believe we can exploit venables english package to easily support english lang.

Just use match()

This is much faster. Good GOD did I overengineer this package.

Feature request - warning instead of error when applying to_logical to other than character vector

Not sure if this nice little package is still maintained. This is a feature request.

Currently, to_logical does not accept anything else than character vectors. That's really limiting.
A very frequent use case would be to be able to pass this function in for example dplyr::mutate on a set of columns selected with tidy select, even if this should sometimes capture other columns than characters - instead of resulting in an error, it would be good if just the same vector would be returned and maybe a warning instead.

library(batman)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
foo0 <- foo1 <- data.frame(cat1 = c("Y", "N"))
foo1 <- data.frame(cat1 = c("Y", "N"), cat2 = c(T, F))
foo2 <- data.frame(cat1 = c("Y", "N"), cat2 = c(T, F), cat3 = 0:1)

mutate(foo0,across(everything(), to_logical))
#>    cat1
#> 1  TRUE
#> 2 FALSE
mutate(foo1,across(everything(), to_logical))
#> Error: Problem with `mutate()` input `..1`.
#> x Expecting a string vector: [type=logical; required=STRSXP].
#> ℹ Input `..1` is `(function (.cols = everything(), .fns = NULL, ..., .names = NULL) ...`.
mutate(foo2,across(everything(), to_logical))
#> Error: Problem with `mutate()` input `..1`.
#> x Expecting a string vector: [type=logical; required=STRSXP].
#> ℹ Input `..1` is `(function (.cols = everything(), .fns = NULL, ..., .names = NULL) ...`.

Created on 2021-03-21 by the reprex package (v1.0.0)

Multilingual support?

Great idea! How about multilingual support, either as a function argument or in response to the language environment?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.