usually I use the tukey.add.test from the asbio package in order to check interaction between treatmest and block in ANOVA RCBD, the package is now archived so I can no longer use this function or anything from the package.
You guys know another function to check this interaction? Any suggestion?
Done, the agricolae::nonadditivity function does the same test with the exactly same p.values.
Related
How can I find what package a function is in?
I'm just learning R and sometimes know what function I want but can't remember which package it's in - is there another function or easy way to look this up? The github cheatsheets show which functions are in a package, but I'm looking for the reverse - I've been googling but looking for a function etc. to find this. Thanks!
I Installed the package "vegan" but cant seem to run it. When I use the command library(vegan) I get this message
.
Any ideas? I normally just use R cmdr so excuse me if this is a silly question.
Also: Is there any plugin to cmdr for NMDS ordination that I can use instead?
That wasn't a "problem". It was only a "message" and not even a particularly dangerous message. It was telling you that the vegan package had a function of the same name as another function in the pls package. If you know that you will be using the scores function with the syntax of the pls::scores function at a later time, then you will need to use it with that form. If you just use scores you will get the function as it exists in pkg:vegan.
I'm being mute about the second part (although it may be premised incorrectly on your anxiety about the message, in which case the question is moot). Multipart questions are discouraged on SO.
To answer your question about Rcmdr plugin for NMDS: check BiodiversityR package that provides an Rcmdr GUI to a part of vegan (plus more).
I am using the "mcr" package for deming regression. When i try to use the functions
mc.analytical.ci()
mc.bootstrap()
i get an errer saying "could not find function "(one of the two functions above)" "
But I don't have any trouble using other functions, like
plotDifference()
Stangely they are not available, but the manual don't tell anything about not using them.
Anyway you can use them as:
mcr:::mc.analytical.ci()
I realize there are generic functions like plot, predict for a list of packages. I am wondering how could I get the R script of these generic functions for a specific package, like the lme4::predict. I tried lme4::predict, but it comes with error:
> lme4::predict
Error: 'predict' is not an exported object from 'namespace:lme4'
Since you state that my suggestion above was helpful I will tell you my process. I used my own co-authored package called pacman. This package was developed because we had a hard time remembering all the obscurely named functions to get information on and work with add on packages.
I used this to figure out what you wanted:
library(pacman)
p_funs(lme4, all=TRUE)
I set all = TRUE as predict is a method for a specific class (like print, summary and plot). Generally, these methods are not exported so p_funs won't return them unless you set all = TRUE. Then I scrolled down to the p section and found only a single predict method: predict.merMod
Next I realized it wasn't exported so :: won't show me the stuff and extra colon power is needed, hence: lme4:::predict.merMod
As pointed out by David and rawr above, some functions can be suborn little snippets (methods etc.), thus methods and getAnywhere are helpful.
Here is an example of that:
library(tm)
dissimilarity #The good stuff is hid
methods(dissimilarity) #I want the good stuff
getAnywhere("dissimilarity.DocumentTermMatrix")
Small end note
And of course you don't need pacman to look at functions for packages, it's what I use and helpful but it just wraps base R things. Use THE SOURCE to figure out exactly what.
I'm using the randomForest package (v 4.6-7) in R (v 2.15.3) and can easily use the function randomForest to create a model. However, when I try to predict on my test set, the predict.randomForest function cannot be found. I've also tried plotting with plot.randomForest only to get the same error, "could not find function."
I've already tried reinstalling the package (figuring maybe it was out of date) and made sure the spelling is absolutely correct. I cannot figure out what's causing this error, any ideas?
It appears that the functions of interest are not exported from the package.
If you use ls(package:randomForest) you'll get a list of the exported functions.
If you want to see all the functions available the use: ls(getNamespace("randomForest"), all.names=TRUE). Thanks #Joshua.
You'll see the functions you want there.
In order to refer to one of them explicitly, use: randomForest:::predict.randomForest()
or just make a object which inherits the class 'randomForest' and call predict() on it directly.