Rmark: Error in readChar(z, 16) : invalid UTF-8 input

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby plgonzal » Tue Jul 26, 2022 6:50 pm

Hi everyone,
I am running a POPAN model in Rmark. My data have the following format:
Bird.ID ch freq Age DFA.Sex
201 000100000 1 A F
282 000100000 1 A F
46 010000000 1 A F
48 010000000 1 A F
91 001000000 1 A F
93 001000000 1 A F
#process
LBH.proc <- process.data(data= LBH_rmark,
begin.time =2010,
model= "POPAN",
time.intervals = c(1,1,1,1,1,1,3,1), groups = "Age")
# design data
LBH.ddl <- make.design.data(LBH.proc)
#Parameters
Phi.dot=list(formula= ~1)
p.dot=list(formula= ~1)
pent.dot=list(formula= ~1)
Phi.t=list(formula= ~time)
p.time=list(formula= ~time)
pent.t=list(formula= ~time)
N.dot = list(formula= ~1)

# If I run the following models (see below), the first model runs no problem and the second, third and fourth crash despite the mark output file runs successfully (Find one below). The message is:
"Error in readChar(z, 16) : invalid UTF-8 input in readChar()"
After this, I can't include these models in model selections, etc. (i.e., the rest of my code breaks).

If I run the same models but with no groups:
LBH.proc <- process.data(data= LBH_rmark,
begin.time =2010,
model= "POPAN",
time.intervals = c(1,1,1,1,1,1,3,1))
Then, I can run models 1,2,3 but 4 will crash with the same message:

"Error in readChar(z, 1) : invalid UTF-8 input in readChar()"
In addition: Warning messages:
1: In type.convert.default(substr(out[x], regexpr("=", out[x]) + 1, :
'as.is' should be specified by the caller; using TRUE

Again, the output is successful for all the models that can run (including #4 which crashed). I am using the last version of R, Rstudio, Rmark. I cleaned the global environment of Rstudio each time I run the code. What do you think is this, and more important, how do I fix this?
Thanks!
Paulina

#Models:
Phi.dot.p.dot = mark(LBH.proc, LBH.ddl,
model.parameters =
list(Phi = Phi.dot, p = p.dot, pent = pent.t,
N = N.dot))

Phi.time.p.dot = mark(LBH.proc, LBH.ddl,
model.parameters =
list(Phi = Phi.t, p = p.dot, pent = pent.t,
N = N.dot))
Phi.dot.p.time = mark(LBH.proc, LBH.ddl,
model.parameters = list(Phi = Phi.dot, p = p.time,
pent = pent.t,
N = N.dot))
Phi.time.p.time = mark(LBH.proc, LBH.ddl,
model.parameters = list(Phi = Phi.t, p = p.time,
pent = pent.t,
N = N.dot))

###OUTPUT example of second model which crashed in Rstudio
Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 001

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Welcome to MARK plgon on machine DESKTOP-N8JKKIE in subdirectory
"C:\Users\plgon\Documents\Archilochus\DIBSI R workshop\New folder\Structural_Eq" running file "mark003.inp".
This version was compiled by GCC version 11.2.0 using the options:
-cpp -iprefix c:\tdm-gcc-64\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/11.2.0/
-D_MT -D_REENTRANT -U_REENTRANT -D IEEE -D DBLEPRECISION -m64 -mtune=generic
-march=x86-64 -mthreads -O2 -std=f2018 -fimplicit-none -fbounds-check
-funroll-loops -ftree-vectorize -ffpe-summary=invalid,zero,overflow,underflow
-fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -flto
-fall-intrinsics -fopenmp.

This problem will use 7 of 8 possible threads.


INPUT --- proc title ;

CPU Time for the last procedure was 0.01 seconds.


INPUT --- proc chmatrix occasions= 9 groups= 2 etype= POPAN Nodes=
INPUT --- 101 ICMeans NoHist hist= 39 ;

INPUT --- time interval 1 1 1 1 1 1 3 1 ;

INPUT --- glabel(1)=AgeA;

INPUT --- glabel(2)=AgeJ;

* * WARNING * * At least a pair of the encounter histories are duplicates.

Number of unique encounter histories read was 30.

Number of individual covariates read was 0.
Time interval lengths vary and/or not equal to 1.

Data type number is 19
Data type is POPAN

CPU Time for the last procedure was 0.01 seconds.

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 002
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



INPUT --- proc estimate link=Parm-Specific NOLOOP varest=2ndPart ;


INPUT --- model={ Phi(~time)p(~1)pent(~time)N(~1) };

INPUT --- group=1 Phi rows=1 cols=8 Square ;
INPUT --- 1 2 3 4 5 6 7 8 ;

INPUT --- group=2 Phi rows=1 cols=8 Square ;
INPUT --- 1 2 3 4 5 6 7 8 ;

INPUT --- group=1 p rows=1 cols=9 Square ;
INPUT --- 9 9 9 9 9 9 9 9 9 ;

INPUT --- group=2 p rows=1 cols=9 Square ;
INPUT --- 9 9 9 9 9 9 9 9 9 ;

INPUT --- group=1 pent rows=1 cols=8 Square ;
INPUT --- 11 12 13 14 15 16 17 18 ;

INPUT --- group=2 pent rows=1 cols=8 Square ;
INPUT --- 19 20 21 22 23 24 25 26 ;

INPUT --- group=1 N rows=1 cols=1 Square ;
INPUT --- 10 ;

INPUT --- group=2 N rows=1 cols=1 Square ;
INPUT --- 10 ;

INPUT --- design matrix constraints=26 covariates=18;
INPUT --- 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0;
INPUT --- 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0;

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 003
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0;
INPUT --- 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0;

INPUT --- links=26;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Logit;

INPUT --- Log;

INPUT --- mlogit(1);

INPUT --- mlogit(1);

INPUT --- mlogit(1);

INPUT --- mlogit(1);

INPUT --- mlogit(1);

INPUT --- mlogit(1);

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 004
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


INPUT --- mlogit(1);

INPUT --- mlogit(1);

INPUT --- mlogit(2);

INPUT --- mlogit(2);

INPUT --- mlogit(2);

INPUT --- mlogit(2);

INPUT --- mlogit(2);

INPUT --- mlogit(2);

INPUT --- mlogit(2);

INPUT --- mlogit(2);
INPUT --- blabel(1)=Phi:(Intercept);
INPUT --- blabel(2)=Phi:time2011;
INPUT --- blabel(3)=Phi:time2012;
INPUT --- blabel(4)=Phi:time2013;
INPUT --- blabel(5)=Phi:time2014;
INPUT --- blabel(6)=Phi:time2015;
INPUT --- blabel(7)=Phi:time2016;
INPUT --- blabel(8)=Phi:time2019;
INPUT --- blabel(9)=p:(Intercept);
INPUT --- blabel(10)=pent:(Intercept);
INPUT --- blabel(11)=pent:time2012;
INPUT --- blabel(12)=pent:time2013;
INPUT --- blabel(13)=pent:time2014;
INPUT --- blabel(14)=pent:time2015;
INPUT --- blabel(15)=pent:time2016;
INPUT --- blabel(16)=pent:time2019;
INPUT --- blabel(17)=pent:time2020;
INPUT --- blabel(18)=N:(Intercept);
INPUT --- rlabel(1)=Phi gA a0 t2010;
INPUT --- rlabel(2)=Phi gA a1 t2011;
INPUT --- rlabel(3)=Phi gA a2 t2012;
INPUT --- rlabel(4)=Phi gA a3 t2013;
INPUT --- rlabel(5)=Phi gA a4 t2014;
INPUT --- rlabel(6)=Phi gA a5 t2015;
INPUT --- rlabel(7)=Phi gA a6 t2016;
INPUT --- rlabel(8)=Phi gA a9 t2019;

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 005
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

INPUT --- rlabel(9)=p gA a0 t2010;
INPUT --- rlabel(10)=N gA a0 t2010;
INPUT --- rlabel(11)=pent gA a1 t2011;
INPUT --- rlabel(12)=pent gA a2 t2012;
INPUT --- rlabel(13)=pent gA a3 t2013;
INPUT --- rlabel(14)=pent gA a4 t2014;
INPUT --- rlabel(15)=pent gA a5 t2015;
INPUT --- rlabel(16)=pent gA a6 t2016;
INPUT --- rlabel(17)=pent gA a9 t2019;
INPUT --- rlabel(18)=pent gA a10 t2020;
INPUT --- rlabel(19)=pent gJ a1 t2011;
INPUT --- rlabel(20)=pent gJ a2 t2012;
INPUT --- rlabel(21)=pent gJ a3 t2013;
INPUT --- rlabel(22)=pent gJ a4 t2014;
INPUT --- rlabel(23)=pent gJ a5 t2015;
INPUT --- rlabel(24)=pent gJ a6 t2016;
INPUT --- rlabel(25)=pent gJ a9 t2019;
INPUT --- rlabel(26)=pent gJ a10 t2020;

Link Function Used is PARM-SPECIFIC

Variance Estimation Procedure Used is 2ndPart

M(t+1):
327 107

Group 1 = AgeA

U(t)+UL(t):
30 35 68 80 42 12 11 18 31

U(t):
30 35 68 80 42 12 11 18 31

UL(t):
0 0 0 0 0 0 0 0 0

Not Released(t):
0 0 0 0 0 0 0 0 0

Group 2 = AgeJ

U(t)+UL(t):
0 16 22 32 20 5 4 7 1

U(t):
0 16 22 32 20 5 4 7 1

UL(t):
0 0 0 0 0 0 0 0 0

Not Released(t):
0 0 0 0 0 0 0 0 0


-2logL(saturated) = 2216.9014
Effective Sample Size = 572

Number of function evaluations was 39 for 18 parameters.
CPU Time for numerical optimization was 0.05 seconds.
-2logL { Phi(~time)p(~1)pent(~time)N(~1) } = 750.15502
Penalty { Phi(~time)p(~1)pent(~time)N(~1) } = 0.0000000
Gradient { Phi(~time)p(~1)pent(~time)N(~1) }:
0.12915169E-04 0.0000000 -0.35259431E-04 0.0000000 -0.20480238E-04
-0.61881975E-05 -0.50379292E-04 -0.21899250E-04 0.15790936E-04 -0.60475009E-04
-0.19369748E-04 -0.85245466E-05 -0.65022444E-04 -0.14367715E-04 0.20623708E-04
-0.17898299E-04 -0.20855052E-04 -0.25466990E-05
Maximum ABS(G) { Phi(~time)p(~1)pent(~time)N(~1) } = 0.6502244E-04
CPU Time to compute VC matrix was 0.05 seconds.
S Vector { Phi(~time)p(~1)pent(~time)N(~1) }:
127.3189 98.10833 70.50672 44.67981 31.15447
29.10923 26.24285 25.34017 18.62212 18.02777
14.98833 12.87088 8.798075 5.707716 5.018305
4.764020 1.620854 0.7854945
CPU Time to invert VC matrix was 0.01 seconds.
Ratio Threshold = 50.000000 Max Gap (16/17) = 2.9392040 Next Max Gap (17/18) = 2.0634819
Gap Method for Num. of Estimated Parameters { Phi(~time)p(~1)pent(~time)N(~1) } = 18
Threshold { Phi(~time)p(~1)pent(~time)N(~1) } = 0.1300449E-03
Numerical Threshold Method for Num. of Estimated Parameters { Phi(~time)p(~1)pent(~time)N(~1) } = 18
Number of Estimated Parameters { Phi(~time)p(~1)pent(~time)N(~1) } = 18
DEVIANCE { Phi(~time)p(~1)pent(~time)N(~1) } = -1466.7464
DEVIANCE Degrees of Freedom { Phi(~time)p(~1)pent(~time)N(~1) } = 21
c-hat { Phi(~time)p(~1)pent(~time)N(~1) } = -69.845068
AIC { Phi(~time)p(~1)pent(~time)N(~1) } = 786.15502
AICc { Phi(~time)p(~1)pent(~time)N(~1) } = 787.39191
BIC { Phi(~time)p(~1)pent(~time)N(~1) } = 864.43952
Pearson Chisquare { Phi(~time)p(~1)pent(~time)N(~1) } = 46431.396
Possible Encounter Histories { Phi(~time)p(~1)pent(~time)N(~1) } = 1022
Pearson Chisquare df { Phi(~time)p(~1)pent(~time)N(~1) } = 1002
Pearson chat { Phi(~time)p(~1)pent(~time)N(~1) } = 46.338719
Sum(Observed/Expected) { Phi(~time)p(~1)pent(~time)N(~1) } = 46424.336
s-bar { Phi(~time)p(~1)pent(~time)N(~1) } = 44.512094
Fletcher chat { Phi(~time)p(~1)pent(~time)N(~1) } = 1.0181627

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 006
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



PARM-SPECIFIC Link Function Parameters of { Phi(~time)p(~1)pent(~time)N(~1) }
95% Confidence Interval
Parameter Beta Standard Error Lower Upper
------------------------- -------------- -------------- -------------- --------------
1:Phi:(Intercept) -0.1814626 0.3835931 -0.9333050 0.5703798
2:Phi:time2011 -0.9530671 0.4881042 -1.9097512 0.0036171
3:Phi:time2012 -0.7310307 0.4411940 -1.5957710 0.1337097
4:Phi:time2013 -0.3820308 0.4222251 -1.2095920 0.4455303
5:Phi:time2014 -1.2351482 0.4538203 -2.1246360 -0.3456604
6:Phi:time2015 -1.4657889 0.5895303 -2.6212683 -0.3103096
7:Phi:time2016 0.5143910 0.5249480 -0.5145071 1.5432891
8:Phi:time2019 -1.0903167 0.6015929 -2.2694389 0.0888055
9:p:(Intercept) 2.8652019 0.5202085 1.8455931 3.8848106
10:pent:(Intercept) 0.5138937 0.2336499 0.0559399 0.9718475
11:pent:time2012 0.5755279 0.1783298 0.2260014 0.9250544
12:pent:time2013 0.7899825 0.1713677 0.4541018 1.1258632
13:pent:time2014 0.1733479 0.1941631 -0.2072118 0.5539075
14:pent:time2015 -1.1240384 0.2899559 -1.6923519 -0.5557248
15:pent:time2016 -1.2195993 0.2970386 -1.8017950 -0.6374036
16:pent:time2019 -0.7050546 0.2464751 -1.1881458 -0.2219635
17:pent:time2020 -0.4633183 0.2281640 -0.9105196 -0.0161169
18:N:(Intercept) 1.9957975 0.6179045 0.7847047 3.2068903


Real Function Parameters of { Phi(~time)p(~1)pent(~time)N(~1) }
95% Confidence Interval
Parameter Estimate Standard Error Lower Upper
-------------------------- -------------- -------------- -------------- --------------
1:Phi gA a0 t2010 0.4547584 0.0951131 0.2822547 0.6388508
2:Phi gA a1 t2011 0.2433261 0.0551898 0.1516082 0.3665568
3:Phi gA a2 t2012 0.2864899 0.0455293 0.2060262 0.3832114
4:Phi gA a3 t2013 0.3627395 0.0425892 0.2840202 0.4495769
5:Phi gA a4 t2014 0.1951935 0.0386104 0.1302964 0.2819355
6:Phi gA a5 t2015 0.1614808 0.0607788 0.0739847 0.3170266
7:Phi gA a6 t2016 0.5824717 0.0875621 0.4078748 0.7385826
8:Phi gA a9 t2019 0.2189528 0.0798122 0.1009676 0.4116765
9:p gA a0 t2010 0.9460992 0.0265283 0.8636089 0.9798621
10:N gA a0 t2010 334.35807 4.5465838 329.41378 349.43003
11:pent gA a1 t2011 0.1174749 0.0157143 0.0899990 0.1519384
12:pent gA a2 t2012 0.2088785 0.0198118 0.1726895 0.2503564
13:pent gA a3 t2013 0.2588393 0.0214657 0.2190314 0.3030744
14:pent gA a4 t2014 0.1397105 0.0172114 0.1092555 0.1769683
15:pent gA a5 t2015 0.0381752 0.0094707 0.0233805 0.0617399
16:pent gA a6 t2016 0.0346960 0.0088939 0.0209120 0.0570365

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 007
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

17:pent gA a9 t2019 0.0580422 0.0113488 0.0394059 0.0847149
18:pent gA a10 t2020 0.0739143 0.0126940 0.0525735 0.1029763
19:pent gJ a1 t2011 0.1174749 0.0157143 0.0899990 0.1519384
20:pent gJ a2 t2012 0.2088785 0.0198118 0.1726895 0.2503564
21:pent gJ a3 t2013 0.2588393 0.0214657 0.2190314 0.3030744
22:pent gJ a4 t2014 0.1397105 0.0172114 0.1092555 0.1769683
23:pent gJ a5 t2015 0.0381752 0.0094707 0.0233805 0.0617399
24:pent gJ a6 t2016 0.0346960 0.0088939 0.0209120 0.0570365
25:pent gJ a9 t2019 0.0580422 0.0113488 0.0394059 0.0847149
26:pent gJ a10 t2020 0.0739143 0.0126940 0.0525735 0.1029763


Estimates of Derived Parameters
Gross Birth+Immigration Estimates of { Phi(~time)p(~1)pent(~time)N(~1) }
95% Confidence Interval
Grp. Occ. B*-hat Standard Error Lower Upper
---- ---- -------------- -------------- -------------- --------------
1 1 56.765975 9.2675479 41.307815 78.008868
1 2 130.45098 17.007795 101.14294 168.25155
1 3 151.62469 16.004473 123.35876 186.36737
1 4 74.334774 9.9391616 57.263938 96.494562
1 5 25.911416 6.7532180 15.677458 42.825914
1 6 25.226286 7.3456203 14.421616 44.125809
1 7 39.216653 10.164874 23.791044 64.643898
1 8 48.060913 10.680155 31.254193 73.905327
2 1 19.415255 3.2281332 14.046781 26.835482
2 2 44.617202 6.0371891 34.264587 58.097731
2 3 51.859095 5.7573460 41.745810 64.422411
2 4 25.424184 3.4500121 19.510348 33.130580
2 5 8.8622938 2.3200013 5.3504938 14.679066
2 6 8.6279638 2.5327425 4.9110982 15.157864
2 7 13.412988 3.5115559 8.0976246 22.217409
2 8 16.437926 3.6948267 10.638192 25.399562

Net Birth+Immigration Estimates of { Phi(~time)p(~1)pent(~time)N(~1) }
95% Confidence Interval
Grp. Occ. B-hat Standard Error Lower Upper
---- ---- -------------- -------------- -------------- --------------
1 1 39.278685 5.2811808 30.214787 51.061592
1 2 69.840210 6.7234612 57.856006 84.306803
1 3 86.544998 7.2833442 73.406188 102.03550
1 4 46.713345 5.7387193 36.750272 59.377426
1 5 12.764191 3.1635883 7.9096381 20.598232
1 6 11.600901 2.9793585 7.0690717 19.037987
1 7 19.406875 3.8088954 13.257674 28.408210
1 8 24.713849 4.2633710 17.667400 34.570695
2 1 13.434204 1.8746454 10.233001 17.636845
2 2 23.886941 2.4858726 19.490110 29.275666
2 3 29.600359 2.7316761 24.712045 35.455635
2 4 15.977027 2.0190114 12.483999 20.447406
2 5 4.3656437 1.0891590 2.6969981 7.0666882
2 6 3.9677720 1.0306627 2.4045575 6.5472397
2 7 6.6375929 1.3294529 4.4997958 9.7910306
2 8 8.4526986 1.4956522 5.9915221 11.924869

Population Estimates of { Phi(~time)p(~1)pent(~time)N(~1) }
95% Confidence Interval
Grp. Occ. N-hat Standard Error Lower Upper
---- ---- -------------- -------------- -------------- --------------
1 1 23.495016 4.1693486 16.637608 33.178796
1 2 49.963242 5.8517276 39.746131 62.806755
1 3 81.997572 7.1586448 69.123877 97.268877
1 4 110.03647 7.9178064 95.579637 126.67997
1 5 86.627924 7.2973066 73.464976 102.14932
1 6 29.673394 4.6365547 21.885845 40.231955
1 7 16.392583 3.5046693 10.831539 24.808734
1 8 22.646330 4.0877281 15.943385 32.167337
1 9 29.672326 4.6363873 21.885058 40.230506
2 1 8.0358302 1.4644518 5.6385838 11.452267
2 2 17.088566 2.1192077 13.413619 21.770342
2 3 28.045036 2.7039380 23.226105 33.863793

Program MARK - Survival Rate Estimation with Capture-Recapture Data
gfortran(dble) Vers. 9.0 Mar 2022 26-Jul-2022 15:27:13 Page 008
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

2 4 37.634979 3.1028358 32.028119 44.223377
2 5 29.628721 2.7623499 24.690150 35.555115
2 6 10.148976 1.6363877 7.4140314 13.892808
2 7 5.6066363 1.2201005 3.6779131 8.5467954
2 8 7.7455601 1.4340336 5.4048322 11.100012
2 9 10.148611 1.6417429 7.4061646 13.906564

Gross Population Estimates of { Phi(~time)p(~1)pent(~time)N(~1) }
95% Confidence Interval
Grp. Occ. N*-hat Standard Error Lower Upper
---- ---- -------------- -------------- -------------- --------------
1 0 575.08670 20.147220 536.93469 615.94960
2 0 196.69274 9.5349592 178.87456 216.28583

CPU Time for the last procedure was 0.11 seconds.


INPUT --- proc stop;

CPU Time in minutes for this job was 0.00

Time Start = 15:27:13.093 Time End = 15:27:13.283

Wall Clock Time in minutes for this job was 0.00


E X E C U T I O N S U C C E S S F U L
plgonzal
 
Posts: 5
Joined: Tue Jul 26, 2022 5:33 pm

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby jlaake » Tue Jul 26, 2022 7:08 pm

What version of R and RMark are you using? This is a problem with reading of the binary file from MARK into R. You said that you used groups in the first example but the process.data call didn't specify groups. If you use groups, you should use ~group for formula for N otherwise if you use ~1 you are saying that f0 (number missed) is the same in each group which is not likely.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby plgonzal » Tue Jul 26, 2022 7:34 pm

Hi! thanks for the quick answer.
I am using Rmark 2.2.7 and R version 4.2.1.
About the groups, you are right! however I have been working without groups and I get the same issue ("Error in readChar..."), specifically in model #4.
plgonzal
 
Posts: 5
Joined: Tue Jul 26, 2022 5:33 pm

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby jlaake » Tue Jul 26, 2022 9:21 pm

Download v 2.2.9 and install it and the problem should disappear. This started to happen in v4 of R. I need to push my more recent version to CRAN.

https://drive.google.com/file/d/1sdtann4ENOiTu7Usks1DoHVW_H6M8z62/view?usp=sharing

Sorry about the problem.

--jeff
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby plgonzal » Wed Jul 27, 2022 1:12 pm

I downloaded the Rmark 2.2.9, and reinstalled Mark (just in case), but the exact problem keeps happening. With no groups, models 1,2,3 run, and 4 crashes with the same message (Error in readChar(z, 16) : invalid UTF-8 input in readChar(). If I run these with groups, model 1 runs, all the rest don't.
Any suggestions?
Thanks!
plgonzal
 
Posts: 5
Joined: Tue Jul 26, 2022 5:33 pm

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby jlaake » Wed Jul 27, 2022 2:17 pm

Ok. I was able to repeat this with the dipper example. Before it was only issuing a warning and I suppressed that because I don't use the readChar value. Appears they changed to an error. I'll have to debug and figure out a workaround. When I do I'll get back to you. Changes in R versions are very frustrating for me.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby plgonzal » Wed Jul 27, 2022 5:25 pm

Thanks so much! please let me know.
plgonzal
 
Posts: 5
Joined: Tue Jul 26, 2022 5:33 pm

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby jlaake » Wed Jul 27, 2022 6:33 pm

Jim Hines very kindly shared some code that he wrote to solve the problem. I have plugged this into the current development version 3.0.0. Note that this version is still in development and will change. When it is posted to CRAN I will send a message to phidot and you should reinstall if from CRAN at that time. But in the meantime it will suffice for what you want to do. See link below to download file. It worked for me with the dipper example so it will presumably work for you. Let me know.

https://drive.google.com/file/d/1eEjeLtdOM3IvNpYSx2pysn6ZNKwNNTU-/view?usp=sharing
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby jlaake » Wed Jul 27, 2022 6:38 pm

I just noticed that Jim's code does not label the derived parameters (model$results$derived) so I'll have to change that part of the code. However in the meantime it will work for you.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Rmark: Error in readChar(z, 16) : invalid UTF-8 input

Postby plgonzal » Wed Jul 27, 2022 8:07 pm

It runs!! Thanks!!!
plgonzal
 
Posts: 5
Joined: Tue Jul 26, 2022 5:33 pm

Next

Return to RMark

Who is online

Users browsing this forum: No registered users and 12 guests