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

Add a method to insert a column to last index #2175

Closed
pdeffebach opened this issue Apr 6, 2020 · 3 comments
Closed

Add a method to insert a column to last index #2175

pdeffebach opened this issue Apr 6, 2020 · 3 comments

Comments

@pdeffebach
Copy link
Contributor

I've been experimenting with piping via Lazy's @> macro. And the new funcitonality.

It all works super well! However one feature that would be nice is an insertcols! method that doesn't take an index for position. The current syntax to insert a column with a particular name at the end of the dataframe -- with a function call where df is the first argument -- is

y = rand(nrow(df))
transform(df, 1 => (x -> y) => :y)

Which is kind of a pain.

@bkamins
Copy link
Member

bkamins commented Apr 6, 2020

insertcols!(df, :y => y) works on master.

@bkamins bkamins closed this as completed Apr 6, 2020
@pdeffebach
Copy link
Contributor Author

great! I thought I was on master but I guess not!

@bkamins
Copy link
Member

bkamins commented Apr 6, 2020

OK - but please check (there is always a risk we have a bug)

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

2 participants