Displaying 20 results from an estimated 20000 matches similar to: "Namespace problem"
2009 Oct 26
2
R CMD check: Error in .C
Function/file names are hypothetical. Say I have written myfunction.R,
which calls myfunction.c via .C("myfunction", ...).
I've compiled successfully myfunction.c via R CMD SHLIB myfunction.c
in the terminal. Then, in the R console:
dyn.load("myfunction.so")
source("myfunction.R")
test <- myfunction() # works fine
So everything is in order, myfunction works
2007 Mar 21
1
Integer Optimization
Hello everybody,
I am looking for a function (or package) which can solve a integer
optimization problem. I have found the glpk package but I don't known
very well how to use it.
Someone has another solution ?
thx
2008 Jan 23
1
Package Building and Name Space
... sorry for reposting this in a more appropriate forum than r.general ...
Hello,
I just don't get this and would appreciate if someone could write a line or
two: I'm trying to build this package and it stops installing after I add
the following to the NAMESPACES file:
>importFrom(gsubfn,strapply)
The error during the package test is:
Error in MyPackage::MyFunction :
package
2008 Jan 23
1
Package Building and Name Space
Hello,
I just don't get this and would appreciate if someone could write a line or
two: I'm trying to build this package and it stops installing after I add
the following to the NAMESPACES file:
>importFrom(gsubfn,strapply)
The error during the package test is:
Error in MyPackage::MyFunction :
package 'MyPackage' has no name space and is not on the search path
Calls:
2014 Apr 03
1
summary of lme4.0 model in package
Dear all,
My package has Depends: lme4.0 in the DESCRIPTION. I need to extract the fixed effect of a model and their standard errors. I use coef(summary(model)) inside a function to do that. Model is the output of a call to glmer() from the lme4.0 package.
coef(summary(model)) throws an error: $ operator is invalid for atomic vectors
I have tracked it down to a problem with summary(model)
2007 May 21
1
accessing unexported functions
I need to access some internal function of a package temporarily.
These functions normally that are not visible outside of the package.
I know the MyPackage:::myfunction mechanism,
but that does not solve my problem.
Instead, I need to add the "internal namespace" of the package
to the search path, then I can run a few commands with these functions
available, and then the internal
2007 Feb 05
2
Exact matching with grep
Hello,
I would know if it is possible with grep to match a exact string. For
example, I want to match the string "DP2" (and only this) and grep match
"DP2BS" too.
I have sought in the grep help but I didn't find what I want.
2012 Oct 30
1
print and execute functions in a package namespace
Let's say I have a package that consists of a set of functions, fig1(),
fig2(), fig3() ..., each of which
produces a plot, and perhaps some printed output, e.g.,
fig1 <- function() plot(1:10)
fig2 <- function() plot(10:1)
fig3 <- function() {y<-sample(1:10,10); plot(y); y}
I'd like to produce a document (PDF or HTML) containing the listing of
each function and its output,
2011 Nov 27
1
Error in Rd[[which]] : subscript out of bounds
I'm getting the following form R CMD CHECK mypackage
-----------
* checking Rd files ... WARNING
Error in Rd[[which]] : subscript out of bounds
problem found in ?myfunction.Rd?
---------
This is... not the most helpful error.
I'd be happy to make a minimal .Rd example file if someone can point me to what a minimal .Rd file has in it.
The file is already pretty minimal, so it's
2006 Apr 03
1
do.call method within namespace
How does one go about invoking a method within a namespaced
package if that package has not been loaded via library
method?
Given "mypackage" and method "foo" within:
mypackage::foo(1, 2, 3)
Executing the same method's function call:
do.call("foo", list(1, 2, 3))
didn't work. Nor did the following:
do.call("mypackage::foo", list(1, 2,
2013 Jul 31
1
Depends vs Imports
I am being asked to modernize the Depends line in the DESCRIPTION file
of some packages. Writing R Extensions says:
The general rules are
Packages whose namespace only is needed to load the package using
library(pkgname) must be listed in the ?Imports? field and not in
the ?Depends? field. Packages listed in imports or importFrom
directives in the NAMESPACE file should
2012 Feb 03
1
incomplete final line found on <name of my sourced function file>
Dear R-ers,
I hope there is a really simple solution to my problem.
I've written a function that I saved in an .r file. I source this file
in my code. For a while it worked fine. But then when I run the line:
source("F mylineplot.r")
I started getting a warning:
In readLines(file) : incomplete final line found on 'F mylineplot.r'
I have no idea why - I tried to check and
2006 May 16
3
multiple plots in a function()
Dear all,
I have the following problem:
I have written a function genereating to plots, eg
myfunction <- (data, some.parameters) {
#some calculations etc
.
par (mfrow=c(1,2))
plot1(......)
plot2(.....)
}
which works fine. But for analysing several variants, I tried a slope, eg:
par (mfrow=c(5,5))
for ( i in 1:10) {
myfunction(data, i)
}
Off
2007 Feb 08
1
Impossible to get jpeg or png output
Hi,
When I want to output a png file, I have the following error message :
Error dans X11(paste("jpeg::", quality, ":", filename, sep = ""), width, :
inpossible de d?marrer le p?riph?rique JPEG
De plus : Warning message:
impossible d'ouvrir le fichier JPEG 'Test.jpeg'
or in english
Error in X11(paste("jpeg::", quality, ":",
2009 Jul 24
4
Include files?
Hi,
I have 15 or 20 functions I've written to convert the sort of data
I'm working with. They are currently in their own R file which I load
by hand in Rgui before loading and running my main programs.
Is there any way to have this file included in my R program like
#include might in C?
If not is there a simple newbie-type example of how to create a
package so I could just say
2012 Mar 18
1
Namespace dependency not required
Hi,
I am working at adding namespace to my packages, carefully following the
doc "Writing R extensions" and some threads on the web. However I cannot
find clear explanation about how to best deal with the import or
importFrom functions in the name space. To make it short:
To declare dependencies in the description file either after Depends:
(packages including functions that are
2011 Jan 16
5
Winelib Calling POSIX function from Windows application
Suppose that I have Windows application using
Code:
LoadLibrary
followed by
Code:
GetProcAddress
It should be possible to load a library implemented in terms of POSIX function but I do not understand how. Should I load the dll.so file generated by winegcc or do i need a plain .dll file?[/code]
2020 Oct 31
2
raster::levels() not working in packaged function.
Apologies, I cannot see how to make a rero for this issue.
I have a function that uses levels(r) tor return the RAT of a raster "r"
when the function is sourced from a script
source(".\R\function.r")
it works fine.
when the function is built into a package and sourced from there
library(mypackage) using the same script file to make the package
levels(r)[[1]]
the same line
2007 Nov 16
1
How do I import packages with the package I've built?
I have successfully completed building a package to contain the
functions I commonly use. However, I need to have other packages
installed in order for some of my functions to work. I've been studying
the instructions on installing packages for about a month now, but still
haven't figured this one out. From what I do understand, to import
additional packages I need some combination of
2004 Nov 29
2
Building latest version of package
Hi
I have a package which was built using R 1.9.1 and everything worked
fine. I recently upgraded to R 2.0.1 and tried to re-install my package
- and I got:
Error in library(mypackage) : 'mypackage' is not a valid package --
installed < 2.0.0?
So I tried rebuilding it using my new version of R:
R CMD BUILD --binary mypackage
hhc: not found
cp: cannot stat `mypackage.chm': No