Displaying 2 results from an estimated 2 matches for "dist_tow".
2005 Nov 10
2
IF/Else
...ity estimates for different types of sampling gear.
My code is:
bmd=for (i in 1:length(Gear)){
if (Gear==20) {bioden=Biomass/141}
else {if (Gear==23) {bioden=Biomass/68}}
else {if (Gear==160) {bioden=Biomass/4120}}
else {if (Gear==170) {bioden=Biomass/2210}}
else {if (Gear==300) {bioden=Biomass/(DIST_TOW*4*1853)}}
else {if (Gear==301) {bioden=Biomass/(DIST_TOW*4*1853)}}
}
The syntax that is returned is:
> bmd=for (i in 1:length(Gear)){
+ if (Gear==20) {bioden=Biomass/141}
+ else {if (Gear==23) {bioden=Biomass/68}}
+ else {if (Gear==160) {bioden=Biomass/4120}}
Error: syntax error in:
"else...
2005 Nov 21
3
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
Can anybody tell me what this means.
thanks
Cam...