R package plyr:count output int not num
1
0
Entering edit mode
23 months ago
3095916029 • 0

I have a dataframe data3_back, and I want to sum value which have same "bp".

enter image description here

So I use this

> data3_back1<-count(data3_back,"bp")

But the output "freq" is int rather than numeric.

enter image description here

Is there anyway to handle it? Or is there any other way to achieve my purpose?

R • 799 views
ADD COMMENT
0
Entering edit mode

Please do not post the images of the data. try as.numeric

ADD REPLY
0
Entering edit mode

Thank you for your reply. I make a silly mistake and I misunderstand the function of "count".

ADD REPLY
1
Entering edit mode
23 months ago

This will sum the values of the value column for rows that have the same bp:

 data3_back1 %>%
     group_by(bp) %>%
     summarise(tot_sum = sum(value))

However, your example with count seems to indicate you want to do something else - could you clarify the question?

ADD COMMENT

Login before adding your answer.

Traffic: 1725 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6