First time asking a question.
I am relatively new to using R. Using it on a project for the Party package (cforest, ctree) which has no implementation in Python.
I receive no warnings in my code until I plot a ctree, at which point I get a varying number of the same two warnings each time I plot a new ctree. The two types of warnings are shown below:
Warning messages:
In model#fit(data, ...) : cmvnorm: completion with ERROR > EPS
In model#fit(data, ...) : cmvnorm: N > 1000 or N < 1
I’ve determined these warnings are coming from the libcoin package, but I don’t understand them.
To be clear, I am getting a plot. The results seem reasonable. I just want to know what these warnings are trying to convey so I can know to disregard or not.
Any help is appreciated.
Related
When trying to use the aodml funciton to fit a beta-binomial distribution GLM with my own data I get a warning message, stating that there are NaNs produced. When I tried to run the same function with the dataset given in the example of the aods3 package I get the same warning messages.
Code:
library(aods3)
data(orob2)
fm1<-aodml(cbind(m, n-m)~seed, data=orob2, family="bb")
Warning messages:
1: In lbeta(a, b): NaNs produced
I have an inkling that the warning is caused by the cbind(m, n-m) but I don't know why or how? Any ideas, especially strange since this is happening with the example data? Am I missing something here?
The problem here is that the optimization procedure tries a negative value of the dispersion parameter along the way. You can see this yourself by setting
options(warn=2, error=recover)
which specifies that warnings get converted to errors, and that errors trigger debug mode. Once you do this, re-run the aodml(...) command, choose frame 4, and print the values of m, n, mu, and k being passed to dbetabin. You'll see that k is negative.
You can resolve this by setting phi.scale="log", which will fit the dispersion parameter on a log scale (which makes more sense anyway).
I'm creating an SVM for two-class classification with R package e1071, using functions svm() and tune.svm() and a set of around 10 numerical features. svm() works fine and tune.svm() too, producing even better results with optimized C and gamma parameters.
However, when I add a categorical variable to my set of features, svm() still works fine, but tune.svm() produces the following error:
Error in if (any(co)) { : missing value where TRUE/FALSE needed
In addition: Warning message:
In FUN(newX[, i], ...) : NAs introduced by coercion
I cannot make sense of this error message. The categorical variable has 5 levels, and everyone of them is represented in the data. In my unexperience, it seems like tune.svm() cannot handle creating and tuning an SVM when there are categorical features involved, but I'm sure there has to be a straightforward solution to this, something I'm missing.
Despite looking through the (often rather concise) e1071 manuals to be found online, and finding several forum threads on related topics (errors with tune.svm() etc.), I haven't been able to find an answer to this specific situation. Can anyone help me out?
My question is with regards to creating a weighted box plot using ENmisc library. I have a dataframe and I want to plot the boxplot based on two different categories (both type chr).
The error given is ## Error: missing value where TRUE/FALSE needed from the line wtd.boxplot(df2J$mean_P32 ~ df2J$mode_Litho,weights=df2J$length). I've attached a log of the portion of code in question below which shows the values of each data type as well as that there is not any data missing. The last line produces a boxplot similar to the one I would expect from the line above.
Unfortunately I don't know how to recreate this error with a general example so I haven't provided code that can be run.
If anyone could shed some light on this error it would be much appreciated.
Other Info:
The plots work if I use the base package boxplot function.
There are other ways I could create weighted boxplots if needed such as this but I really don't see any reason this shouldn't work.
wtd.boxplot function
ENmisc library
I'm not sure why this doesn't show up in the Knitr ourput but The error that shows up in the R console is Error in if (any(out[nna])) stats[c(1, 5)] <- range(x[!out], na.rm = TRUE) :
missing value where TRUE/FALSE needed
I have the same problem and it happens because (I think) you have only 1 member for one of your groups. Check it.
I tried to apply stability function in ClustOfVar package and got an error message as below:
Error in La.svd(x, nu, nv) : error code 1 from Lapack routine 'dgesdd'.
I intended to do the variable clustering on a data set including both quantitative and qualitative variables. The R codes I uses are shown as below. At first I use the data directly (i.e., without standardization of the quantitative variables) and got the error message when running the stability function). Then I scale the quantitative variables and rerun the codes and got the same error message. Would someone give a suggestion how to fix the problem? Also, I do not think it need no step to standardize the quantitative variables because the hclustvar function should contain the standardization, right?
X.quanti<-Data4Cluster[, c(9:28)]
X.quanti2<-scale(X.quanti, center=TRUE, scale=TRUE)
X.quali<-Data4Cluster[, c(1:4,8)]
tree<-hclustvar(X.quanti,X.quali)
plot(tree)
stab<-stability(tree, B=40)
tree2<-hclustvar(X.quanti2,X.quali)
plot(tree2)
stab<-stability(tree2, B=40)
I am having exactly the same problem. The only thing that fixed it for me was changing the value of B (reducing it to 20) but I don't think it is right so I hope someone can give us a solution. My worry from searching the web is that there is a bug in the Lapack package which seems unfixable (this error is a common occurrence with various functions).
I had this error using the MASS::lda function. The error went away when I removed collinear variables from the model.
As title, I have collected data for 1:6 matched case-control study and I am trying to analyze the data using matchTab, but it gives me error "subscript out of bounds", I wonder if anyone here has met anything similar before. What does it mean? Some issue about my dataset? As I have tried the manual, I can get the result using the dataset used in the manual.
Thanks.
That error often arises from matrix subsetting beyond the dimensions of the object. Try this for example:
mat <- matrix(1:9, ncol = 3)
mat[,4]
with the last line yielding
> mat[,4]
Error: subscript out of bounds
This sometimes happens in code because the programmer forgot that [ drops empty dimensions - I've done this myself many times, forgetting the 1 column matrix case! I'm not saying this is the problem here, but is one common cause of it in R code.
As you haven't provided a reproducible example and I am unfamiliar with the package you mention, I can't diagnose the problem further. It could be a bug in their package or a problem with how you have supplied, or understood you needed to supply, data to the function.
First thing I would do is re-read the man page for the function. Confirm you have the arguments supplied correctly. If that doesn't help, rerun to generate the error and then call traceback() to see exactly in what function the error is being raised. To debug further, try
options(error = recover)
then rerun your code. This will drop you into the debugger so you can go into the frame where the error occurred and see what all the objects were like, how they were sized etc. and why the error was being raised.
If you are not up to debugging this yourself, you might need to contact the maintainers, or provide a reproducible example...