[R] Warning message help

2005-11-21 Thread Guenther, Cameron
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
[EMAIL PROTECTED]

__
R-help@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


Re: [R] Warning message help

2005-11-21 Thread tom wright
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
> [EMAIL PROTECTED]
> 
> __
> R-help@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
>

__
R-help@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


Re: [R] Warning message help

2005-11-21 Thread Mike Prager
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.

__
R-help@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


Re: [R] Warning message help

2005-11-21 Thread Petr Pikal
Hi



On 21 Nov 2005 at 10:44, Guenther, Cameron wrote:

Date sent:  Mon, 21 Nov 2005 10:44:58 -0500
From:   "Guenther, Cameron" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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 length 

basically 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
> [EMAIL PROTECTED]
> 
> __
> R-help@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

Petr Pikal
[EMAIL PROTECTED]

__
R-help@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