R can't find function after installing package [closed] - r

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I'm trying to use the function isdigit but R can't find it, even after I installed the qmrparser package and submitted the code library(qmrparser).
(I'm brand new to R so please explain like I'm 5!)

Try
library(qmrparser)
to load / attach the package. Failing that, try
qmrparser::isdigit()
to call it up explicitly using the :: operator along with the package name.
You can have thousands of packages installed, so installed does not automate loading (though you can arrange for that, but that is a different topic).
Edit: And if the function is not accessible even after loading try the 'triple-:' operator to access non-exported sysmbols:
qmrparser:::isdigit()
Edit 2: Your premise was wrong as the function is called isDigit with a capital-D. So you have to type
isDigit()
which will get you the function as it is exported via NAMESPACE.

Related

R sommer package - version out of date message [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
Using the sommer package quite extensively I often get messages telling my version is out of date even though I'm using the latest version of the package. This can be especially annoying when using sommer in some sort of loop.
Is there a way to avoid these messages?
Hi BartJan welcome to SO!
Have you tried calling the library with quietly = TRUE?
library(sommer,quietly = TRUE)
If that doesn't work, you can make R suppress all messages and warnings:
suppressMessages(suppressWarnings(require(xyz)))

Mark a function as deprecated in customised R package [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I built my first R package months ago and I now realise some of my older functions are looking a bit dated. I'm already writing better functions to replace them.
I've seen how other R packages warn of deprecated functions, and redirect users to the newer functions. I want to do the same.
How do I mark a function as deprecated in R? Do I just set a warning?
The answer is to call the .Deprecated function from base R:
f_old = function(x) {
.Deprecated("f_new")
return(x * x)
}
f_new = function(x) {
return(x^2)
}
This will give the appropriate warning:
> f_old(4)
[1] 16
Warning message:
'f_old' is deprecated.
Use 'f_new' instead.
See help("Deprecated")

render function not recognised in R Studio [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
Bit of a newbie for R, R Studio and Markdown but I am trying to use the render() function on my Rmd file and I get the following error:
Error: could not find function "render"
If I try to use the following I get this error:
markdown::render("MarkdownExample.Rmd")
Error: 'render' is not an exported object from 'namespace:markdown'
Still yesterday I could use the render fonction without any problem. Would anyone know what to do?
Thanks in advance
Shouldn't it be rmarkdown::render?

Function error in R "setnames" [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I made an upgrade in R, and since then, I have a lot of errors in programs which were working well before.
The one I cannot go around is :
Error: could not find function "setnames"
I am loading the packages (
library(plyr)
library(dtplyr)
library(tidyr)
library(lsr)
library(ggplot2)
library(stats)
and i am using R :
platform x86_64-w64
major 3
minor 3.2
Does anybody knows how to go around please ?
It's probably a typo, if you're referring to setNames in stats.
Remember to capitalize the 'n'.
See https://stat.ethz.ch/R-manual/R-devel/library/stats/html/setNames.html
(The other possibility is that you may not have loaded the data.table package. See, for example, Using data.table::setnames() when some column names might not be present)

Not able to install packages in R with install.packages() [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have installed R Version 3.0.2. I am trying to run association analysis on a dataset.
While trying to install the arules package, using the code:
install.packages(“arules”)
I get and error:
Error: unexpected input in "install.packages(“arules")
Can you guide as to how I can install this package and use it to run association on an imported txt file using R?
You appear to be using "smartquotes" instead of straight quotes like " around arules. R cannot recognize these. Change to straight quotes and everything should work.

Resources