Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Names with spaces #326

Open
statspy-ml opened this issue Mar 1, 2021 · 2 comments
Open

Names with spaces #326

statspy-ml opened this issue Mar 1, 2021 · 2 comments

Comments

@statspy-ml
Copy link

statspy-ml commented Mar 1, 2021

everything goes well with simple column names like "Name", "Full_Name", "Age", but i cant get it done when i have field names with spaces like "Full Name", "ID Number".
This works,

df = x |>
@filter(_.Age > 2) |>
@map({_.Name}) |>
DataFrame  

this does not work:

df = x |>
@filter(_.Age> 2) |>
@map({_."Full Name"}) |>
DataFrame

What i am doing wrong?

@dwinkler1
Copy link

You could do

x |> @filter(_.Age>2) |> @select(occursin("Full Name")) |> DataFrame

@drbenvincent
Copy link

drbenvincent commented Jun 12, 2021

It could be handy to have helper function/macro to clean the column names. Like this... https://cran.r-project.org/web/packages/janitor/vignettes/janitor.html#clean-data.frame-names-with-clean_names

Edit: similar to #272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants