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

Trouble using aggregate function in R #639

Closed
yaaminiv opened this issue Jun 13, 2017 · 3 comments
Closed

Trouble using aggregate function in R #639

yaaminiv opened this issue Jun 13, 2017 · 3 comments

Comments

@yaaminiv
Copy link
Contributor

I have a spreadsheet with protein names and associated peak areas, but each protein transition has it's own row:

screen shot 2017-06-13 at 12 42 17 am

I want to average the peak area for each transition, so I have one row in my spreadsheet per protein. I'm using the aggregate function in R to average peak areas for each protein. I'm using na.rm and na.action to handle all of the N/A values in my spreadsheet, based on this stack overflow thread.

averageProteinAreas <- aggregate(proteinAreas[-1], proteinAreas[1], mean, na.action = na.omit, na.rm = TRUE)

However, I just get a spreadsheet filled with N/As and the warning message "1: In mean.default(X[[i]], ...) :
argument is not numeric or logical: returning NA"

screen shot 2017-06-13 at 12 45 21 am

Not really sure how to fix this/what the error message is actually saying. Any help would be much appreciated!

@seanb80
Copy link
Contributor

seanb80 commented Jun 13, 2017 via email

@seanb80
Copy link
Contributor

seanb80 commented Jun 13, 2017 via email

@yaaminiv
Copy link
Contributor Author

ahh whoops. thanks @seanb80!

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