Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to reshape this dataframe?

$
0
0

I have the following dataframe where words took the place of default row numbers (1,2,3, etc.):

                       Score
commitment            -0.9843452
progress              -0.9831530
implement             -0.9785868
decision              -0.9777243
message               -0.9762919
deficit               -0.9752300
invest                0.9929340
multiplier            0.9940889
fiscal_capacity       0.9940889
public_investment     0.9949193
aggregate_demand      0.9955452
space                 0.9960338

I want to achieve two things: 1) the "column" of words to become a proper column (the second column of the dataframe); 2) keep only those words that have a score bigger or equal 0. I tried a lot of solution but I failed. Unfortunately, I don't know how to create a dfm with words instead of numbers so I can't provide you with code (I derived it from list in my real-life scenario).

Is there anyone who can help me with that? Thanks so much!


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>