-
Notifications
You must be signed in to change notification settings - Fork 133
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
Feature request: names_to_row (an approximate inverse function for row_to_names) #434
Comments
Wouldn't this do the trick? Unless I'm missing some other necessary functionality?
|
That's more like the functionality of The goal here is to move the names down to a row, and to make cells that should be |
Oops, I did not give my coffee enough time to work before responding :) |
Can I second this idea as a valuable convenience addition to janitor 👍 |
Can you say a little more about the use case? Bill if you say it's useful I trust that - and thanks @systemnova for chiming in - but I don't follow. If the names were supposed to be the data, I would usually specify Sorry for my inconsistent attention to new feature requests! |
Firstly, thanks for creating such a wonderfully useful package! I think it would just feel more convenient & complete. When I first started looking for convenient pipe-able ways to manipulate names, I kind of felt that the existing function names in this package and others were a little confusing & ended up mapping them to my own function names. In my head the logical set would be:
Or PromoteHeader Although I say this after spending way too much time in SPSS & PowerBI. So it might just be me that feels this way 😉 |
tl;dr: To me, the value of the function is borderline, but it can have use. The correct way to get the data out is usually to use The times that I find it useful is when I get some ugly data that have several layers of column names. For a recent example, the first row had animal sex, the second row had animal number, and then subsequent rows had the data I wanted (drug concentrations over time). I've started using the @systemnova, for the function names suggested, I agree that these don't necessarily please everyone. |
Feature requests
I think a new function that moves the header row to become the first data row would be helpful.
I sometimes receive data where I need to do a lot of mucking about to get the results into a usable format. I use
rio::import()
to import the data files, and then I need to get the data ready for analysis. Sometimes those data files have information I need to convert into a column of information in the header rows, and it would be more helpful to have the header row as part of the data.This would be approximately the inverse of the
row_to_names()
function (so it seems like it could be a fit injanitor
).The proposed function is below (it would need some cleanup before just dropping into the repo). Some features that it has are:
NA
, and set them toNA
.The text was updated successfully, but these errors were encountered: