Entering edit mode
Richard Yanicky
▴
10
@richard-yanicky-3394
Last seen 8.8 years ago
I have an error that occurs with various dataset but always occurs
with a
particular dataset. The dataset is not large and has no missing
values.
I am using R 2.6.1 as a suggestion to isolate the error. Later
versions of R
can cause this error(I am told) and can confirm that this works better
under
2.6.1.
copied from below (The error:):
>
pred=pamr.predict(pamr.fit,newx=as.matrix(t(d.mv2[,pamrimp])),threshol
d=Thresh)
Error in diag.disc((newx - centroid.overall)/sd, delta.shrunk, prior,
:
(subscript) logical subscript too long
If there is other information needed please let me know.
> pamr.fit<-pamr.train(mydata,n.threshold=50);
1234567891011121314151617181920212223242526272829303132333435363738394
041424344454647484950>
pamcv<-pamr.cv(pamr.fit,mydata);
12Fold 1
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 2
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 3
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 4
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 5
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 6
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 7
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 8
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 9
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
Fold 10
:123456789101112131415161718192021222324252627282930313233343536373839
4041424344454647484950
>
> Thresh<-max(pamcv$threshold[pamcv$error== min(pamcv$error)]);
> Thresh
[1] 3.692809
> pamrimplist<-pamr.listgenes(fit=pamr.fit, data=mydata,
threshold=Thresh,genenames=TRUE);
id name 1-score 2-score
[1,] 1 MMSE -1.2997 1.2759
[2,] 2 Ab1.42 -0.3874 0.3803
[3,] 3 Tau 0.2667 -0.2618
[4,] 4 P.Tau.181P 0.2084 -0.2045
[5,] 48 HIPPL.uas -0.1698 0.1667
[6,] 49 HIPPR.uas -0.1557 0.1529
[7,] 10 VENTVOL.bsi 0.1162 -0.114
[8,] 6 LEFTHIPPO.ucsfsntvol -0.0931 0.0914
[9,] 7 RIGHTHIPPO.ucsfsntvol -0.0825 0.081
[10,] 11 VENTVOL.uwo 0.0538 -0.0528
> pamrimp<-pamrimplist[,2];
> Thresh
[1] 3.692809
>
pred=pamr.predict(pamr.fit,newx=as.matrix(t(d.mv2[,pamrimp])),threshol
d=Thresh)
Error in diag.disc((newx - centroid.overall)/sd, delta.shrunk, prior,
:
(subscript) logical subscript too long
In addition: Warning messages:
1: In newx - centroid.overall :
longer object length is not a multiple of shorter object length
2: In (newx - centroid.overall)/sd :
longer object length is not a multiple of shorter object length
> sessionInfo()
R version 2.6.1 (2007-11-26)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] splines stats graphics grDevices utils datasets
methods
base
other attached packages:
[1] pamr_1.31 survival_2.34 cluster_1.11.9
>
[[alternative HTML version deleted]]