[R] weighted averages for two variables

2012-05-19 Thread mpostje
Hi R users, I have a dataset with multiple variables and i'm trying to weigh average depths for fish species per year by their abundance (CPUE. I have tried the weighted.mean function but as i have two columns for the x value the lenghts differ with the w (CPUE). How do I solve this problem? So

Re: [R] weighted averages for two variables

2012-05-19 Thread mpostje
This is the output that i got dput( head(allspecies, 20) ) structure(list(Year = c(1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1980L, 1981L, 1981L, 1981L, 1981L, 1981L, 1981L, 1981L, 1981L), Quarter = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

Re: [R] weighted averages for two variables

2012-05-19 Thread mpostje
It works now :) thank you! -- View this message in context: http://r.789695.n4.nabble.com/weighted-averages-for-two-variables-tp4630589p4630610.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] date and time conversion

2012-05-02 Thread mpostje
Hi I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. the problem is that the database has put a T between the numbers and R will not accept any conversions. this is the format that it's in now 1981-01-02T08:00 can anyone help?

[R] convert numbers into dates and time

2012-05-02 Thread mpostje
Hi I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. the problem is that the database has put a T between the numbers and R will not accept any conversions. this is the format that it's in now 1981-01-02T08:00 can anyone help?