Alex DJ
2011-Nov-10 18:12 UTC
[R] Error in matrix, not ordered vectors or numerical value, and SIAR.
Help! model1 <- siarmcmcdirichletv4(data, source, tef, concdep=0, 500000, 50000) Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow (siardata$iterations - : invalid 'ncol' value (too large or NA) In addition: Warning message: In Ops.ordered((numsources + numiso), numgroups) : '*' is not meaningful for ordered factors Previous message, but more problems:> The data set has 101 values, what can I use instead of letters?Why do you need to use letters? AFAIK this was only illustration what could be root of the error message. If the function requires ordered factor you can use your.ordered.factor <- ordered(your.unordered.factor) I do not remember original mail but to get rid of error message, the function probably needs as an input ordered factor or numeric values. You shall consult help page for this function which option is valid. as.numeric comes back as NA for the pond dataset (A3, A5, A7, B3, B7, C2) Cannot use ordered factor as * function does not work for this. ? And is needed to run the model (see below). ANYONE know max length for dataset in SIAR? NOW getting following error: model1 <- siarmcmcdirichletv4(data, source, tef, concdep=0, 500000, 50000) Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow (siardata$iterations - : invalid 'ncol' value (too large or NA) In addition: Warning message: In Ops.ordered((numsources + numiso), numgroups) : '*' is not meaningful for ordered factors Matrix 1 has only 6 vectors in column 1. Thank-you. Alex. -- View this message in context: http://r.789695.n4.nabble.com/Error-in-matrix-not-ordered-vectors-or-numerical-value-and-SIAR-tp4024578p4024578.html Sent from the R help mailing list archive at Nabble.com.
Petr PIKAL
2011-Nov-11 06:39 UTC
[R] Odp: Error in matrix, not ordered vectors or numerical value, and SIAR.
Hi> Help! > > model1 <- siarmcmcdirichletv4(data, source, tef, concdep=0, 500000,50000)> > Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow > (siardata$iterations - : > invalid 'ncol' value (too large or NA) > In addition: Warning message: > In Ops.ordered((numsources + numiso), numgroups) : > '*' is not meaningful for ordered factors > > Previous message, but more problems:Maybe it is time to consult manual and help page for the function you use. For your convenience I coppied it below. I do not use the package so only few comments siarmcmcdirichletv4(data, sources, corrections = 0, concdep = 0, iterations=200000, burnin=50000, howmany=Arguments data A matrix with each food source as a seperate row and each isotope as a seperate column. ^^^^^^^^^^^^^^^^^ most probably a numeric matrix sources A matrix containing the mean and standard deviations of the fractionated correction values for each of the isotopes. Also allows corrections = 0 for pre-corrected data. ^^^^^^^^^^^^^^^^^ again a matrix (numeric) corrections A matrix containing the mean and standard deviations of the fractional correction values for each of the isotopes. Also allows corrections = 0 for pre-corrected data. ^^^^^^^^^^^^^^^^^^ and for the third time a numeric matrix Only you know what are your data, sources and tef objects which you feed to the function. Why not to follow posting guide and uncover it to us, poor helpers. Regards Petr> > > > The data set has 101 values, what can I use instead of letters? > > Why do you need to use letters? AFAIK this was only illustration what > could be root of the error message. If the function requires ordered > factor you can use > > your.ordered.factor <- ordered(your.unordered.factor) > > I do not remember original mail but to get rid of error message, the > function probably needs as an input ordered factor or numeric values.You> shall consult help page for this function which option is valid. > > as.numeric comes back as NA for the pond dataset (A3, A5, A7, B3, B7,C2)> > Cannot use ordered factor as * function does not work for this. ? And is > needed to run the model (see below). > > ANYONE know max length for dataset in SIAR? > > NOW getting following error: > > model1 <- siarmcmcdirichletv4(data, source, tef, concdep=0, 500000,50000)> Error in matrix(1, ncol = (numsources + numiso) * numgroups, nrow > (siardata$iterations - : > invalid 'ncol' value (too large or NA) > In addition: Warning message: > In Ops.ordered((numsources + numiso), numgroups) : > '*' is not meaningful for ordered factors > > Matrix 1 has only 6 vectors in column 1. > > > Thank-you. > > Alex. > > > -- > View this message in context: http://r.789695.n4.nabble.com/Error-in- >matrix-not-ordered-vectors-or-numerical-value-and-SIAR-tp4024578p4024578.html> Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Alex DJ
2011-Nov-11 07:35 UTC
[R] Odp: Error in matrix, not ordered vectors or numerical value, and SIAR.
Thank-you Petr. I have consulted as many manuals and help pages, and search engines, and trying various things in SIAR, but continuous errors prevail.. I have tried changing all matrices to numeric, but the first column , of the two latter matrices, returns as NA. Any other suggestions? I had put in one of these messages more detail about data, see below. pond <- c("A3", "A3", "A3", "B3", "B3", "B3","C2", "A7", "A7") d13C <- c(-22.07, -20.39, -21.11...) d15N <- c(16.06, 17.13, 16.7, ...) FConsumerData <- data.frame(pond, d13C, d15N) FTEFData <- data.frame(tefsources, tefMeand13C, tefSDd13C, tefMeand15N, tefSDd15N) sources <- c("Copepoda", "Algal Paste", "Amphipoda", Meand13C <- c(-26.57, -20.41, -21.65,... SDd13C <- c(1.78, 4.01, 1.46,... Meand15N <- c(15.55, 9.58, 14.07... SDd15N <- c(1.77, 1.34, 1.66,... FSourceData <- data.frame(sources, Meand13C, SDd13C, Meand15N, SDd15N) tefsources <- c("Copepoda", "Algal Paste", "Amphipoda",... tefMeand13C <- c(0.4, 0.4, 0.4,... tefSDd13C <- c(1.3, 1.3, 1.3, tefMeand15N <- c(3.4, 3.4, 3.4, tefSDd15N <- c(1.0, 1.0, 1.0, Hope that helps explain? ?? -- View this message in context: http://r.789695.n4.nabble.com/Error-in-matrix-not-ordered-vectors-or-numerical-value-and-SIAR-tp4024578p4030650.html Sent from the R help mailing list archive at Nabble.com.
Petr PIKAL
2011-Nov-11 12:00 UTC
[R] Odp: Error in matrix, not ordered vectors or numerical value, and SIAR.
> > Re: [R] Odp: Error in matrix, not ordered vectors or numerical value,and SIAR.> > Thank-you Petr. > > I have consulted as many manuals and help pages, and search engines, and > trying various things in SIAR, but continuous errors prevail.. > > I have tried changing all matrices to numeric, but the first column , ofthe> two latter matrices, returns as NA. Any other suggestions? > > I had put in one of these messages more detail about data, see below. > > > pond <- c("A3", "A3", "A3", "B3", "B3", "B3","C2", "A7", "A7") > d13C <- c(-22.07, -20.39, -21.11...) > d15N <- c(16.06, 17.13, 16.7, ...) > FConsumerData <- data.frame(pond, d13C, d15N) > FTEFData <- data.frame(tefsources, tefMeand13C, tefSDd13C, tefMeand15N, > tefSDd15N) > sources <- c("Copepoda", "Algal Paste", "Amphipoda", > Meand13C <- c(-26.57, -20.41, -21.65,... > SDd13C <- c(1.78, 4.01, 1.46,... > Meand15N <- c(15.55, 9.58, 14.07... > SDd15N <- c(1.77, 1.34, 1.66,... > FSourceData <- data.frame(sources, Meand13C, SDd13C, Meand15N, SDd15N) > tefsources <- c("Copepoda", "Algal Paste", "Amphipoda",... > tefMeand13C <- c(0.4, 0.4, 0.4,... > tefSDd13C <- c(1.3, 1.3, 1.3, > tefMeand15N <- c(3.4, 3.4, 3.4, > tefSDd15N <- c(1.0, 1.0, 1.0, > > Hope that helps explain?Not much. FConsumerData is data frame with nonnumeric first column, the same is with FTEFData and FSourceData. If you change it to matrix you will get character matrix. Trying to change character values to numeric obviously leads to NA. How the poor R shall know what number it shall make from A3, B3, C2 or A7? I do not use siar package but in the help page it is clearly stated that input shall be ***numeric*** matrices. Not data frames, not character values not factors. If you do not know distinction among those objects you shall look into R intro document (at least first 6 chapters) which should came along with your installation. BTW, in help page there is out <- siarmcmcdirichletv4(geese1demo,sourcesdemo,correctionsdemo,concdepdemo) It does not produce any error does it? If it does not produce any error it is sign that something is wrong with your data. Look at structure of your objects you are trying to evaluate and compare it with those demo objects. str(object) is the first option when something does not seem to be OK. Regards Petr> > ?? > > -- > View this message in context: http://r.789695.n4.nabble.com/Error-in- >matrix-not-ordered-vectors-or-numerical-value-and-SIAR-tp4024578p4030650.html> Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.