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

tapply and data.frames / vectors #9

Open
marleyhaupt1 opened this issue Feb 6, 2017 · 3 comments
Open

tapply and data.frames / vectors #9

marleyhaupt1 opened this issue Feb 6, 2017 · 3 comments

Comments

@marleyhaupt1
Copy link
Collaborator

Hi Will,

I have been working on question 5 from Session 4 and I am struggling a bit with using tapply. I used expand.grid to create a data.frame of codons and amino acids. However, when I use an input vector of an arbitrary length it spits out an error message:

Error in tapply(input, codons) : arguments must have the same length

This makes sense to me since my input vector is length 1 (i.e, input <- "ATTACTAGGCTACGAA") and my data.frame is length 4 (first nucleotide, second nucleotide, third nucleotide, amino acid), but I am not sure how to fix it.

Also, I'm not sure which function I need to use in tapply to pull out the associated amino acid from the fourth column in my data.frame.

Is there anyway you can help me with this?

Thanks,
Marley

@willpearse
Copy link
Member

Are you free Tuesday afternoon? Say around 2/3 pm?

@marleyhaupt1
Copy link
Collaborator Author

I have a meeting with Paul at 2, can I meet with you at 3?

@willpearse
Copy link
Member

willpearse commented Feb 7, 2017 via email

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