Shouldnt that be effort[Gear==300]<-(DIST_TOW*7412) I think we're going to need to see some sample datasets to tell you any more. On Mon, 2005-21-11 at 10:44 -0500, Guenther, Cameron wrote:> I am trying to great a new column of effort data from an existing vector > of gears used. > It is a simple code where > > effort[Gear==300]=(DIST_TOW*7412) > effort[Gear==301]=(DIST_TOW*7412) > > The code appears to work for some of the data but fails for others and > inserts a NA value > > I also get this warning message > > Warning message: > number of items to replace is not a multiple of replacement length > > Can anybody tell me what this means. > thanks > > Cameron Guenther > Associate Research Scientist > FWC/FWRI, Marine Fisheries Research > 100 8th Avenue S.E. > St. Petersburg, FL 33701 > (727)896-8626 Ext. 4305 > cameron.guenther at myfwc.com > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
I am trying to great a new column of effort data from an existing vector of gears used. It is a simple code where effort[Gear==300]=(DIST_TOW*7412) effort[Gear==301]=(DIST_TOW*7412) The code appears to work for some of the data but fails for others and inserts a NA value I also get this warning message Warning message: number of items to replace is not a multiple of replacement length Can anybody tell me what this means. thanks Cameron Guenther Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 cameron.guenther at myfwc.com
Cameron Assuming DIST_TOW is a vector of the same length as effort and Gear, is this what you mean? effort[Gear==300] = DIST_TOW[Gear==300]*7412 MHP on 11/21/2005 10:44 AM Guenther, Cameron said the following:>I am trying to great a new column of effort data from an existing vector >of gears used. >It is a simple code where > >effort[Gear==300]=(DIST_TOW*7412) >effort[Gear==301]=(DIST_TOW*7412) > >[...] > >-- Michael Prager, Ph.D. Population Dynamics Team, NMFS SE Fisheries Science Center NOAA Center for Coastal Fisheries and Habitat Research Beaufort, North Carolina 28516 http://shrimp.ccfhrb.noaa.gov/~mprager/ Opinions expressed are personal, not official. No government endorsement of any product is made or implied.
Hi On 21 Nov 2005 at 10:44, Guenther, Cameron wrote: Date sent: Mon, 21 Nov 2005 10:44:58 -0500 From: "Guenther, Cameron" <Cameron.Guenther at myfwc.com> To: <R-help at r-project.org> Subject: [R] Warning message help> I am trying to great a new column of effort data from an existing > vector of gears used. It is a simple code where > > effort[Gear==300]=(DIST_TOW*7412) > effort[Gear==301]=(DIST_TOW*7412) > > The code appears to work for some of the data but fails for others and > inserts a NA value > > I also get this warning message > > Warning message: > number of items to replace is not a multiple of replacement lengthbasically it says number of items to replace is not a multiple of replacement length what means that length effort[.....] is different from length DIST_TOW*7412 and that the lengths are not divisible without a reminder so the replacement cannot be fully recycled. HTH Petr> > Can anybody tell me what this means. > thanks > > Cameron Guenther > Associate Research Scientist > FWC/FWRI, Marine Fisheries Research > 100 8th Avenue S.E. > St. Petersburg, FL 33701 > (727)896-8626 Ext. 4305 > cameron.guenther at myfwc.com > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlPetr Pikal petr.pikal at precheza.cz