Displaying 20 results from an estimated 5000 matches similar to: "test suites for packages"
2009 Oct 05
3
unit testing for R packages?
Hi All,
I'm interested in putting some unit tests into an R package I'm
building. I have seen assorted things such as Runit library, svUnit
library, packages
with 'tests' directories, etc
I grep'd "unit test" through the writing R extensions manual but didn't find
anything. Are there any suggestions out there? Currently I have
several (a lot?) classes/methods
2014 Jan 18
1
Using unit-tests as examples
Hi,
Which is the best way to use unit tests as examples for documentation?
I use testthat, but if there is a good way to do this, for example,
only with RUnit, it'd still be good to know.
Unit-tests are usually simple and concise, so they are good candidates
for example code, but I don't want to copy them into documentation and
maintain by hands. I tried to google how people handle this,
2014 Jul 25
1
[Wishlist] a 'PackageDevelopment' Task View
Hello everybody,
as a young/unexperienced R package developer (only a few, mainly
for personal use) i was thinking it could be very useful having a
"meta" task view for all package-development related
packages and/or function.
Something like ...
Creation
- utils::package.skeleton, pkgKitten, Rcpp::Rcpp.package.skeleton
Foreign languages interfaces:
- Rcpp
Documentation
- roxygen2
2009 Jan 31
1
Test Driven Development in R
Hi,
I wonder what kind of interest there is on Test Driven Development (TDD) in R.
Test Driven Development consists of writing the test before the function, and
iteratively build the function until it passes the test.
Python and Ruby (specially Ruby) have very strong test-oriented cultures. In
fact, in Ruby at least the custom is to do TDD and lately Behavior-driven
development (BDD). In BDD,
2014 Jan 22
1
Behavior of --install-tests and testInstalledPackage
Hello,
I'm writing a script that automates the testing of reverse dependencies of a package. I found the function testInstalledPackage in the tools package, which seems to do what I want. However, when I use it for a source package that was installed with --install-tests, I've noticed that only the actual test files (e.g. located in inst/tests) are available and run. In other words the
2012 Mar 02
1
seeing feedback when R CMD check pkg runs unit tests.
good day here,
I'm maintaining a couple of R modules, both on r-forge.
tests for these modules are written making use of unit testing, and I
make use of the svUnit module, part of SciViews-R.
I also make use of examples in the .Rd files.
my question regards 'R CMD check pkg'.
if an _example_ is not run correctly, I get clear feedback on the
command line where I run 'R CMD
2011 Feb 05
1
Reading a specific file during "R CMD check"?
Hello, All:
How can I obtain the location of an example data file in a
package during "R CMD check"?
I want to include sample raw data files in a package and have
them read by a function in the package. It occurs to me to put such a
file in "\inst\rawdata" and have examples find the data using something
like "system.file('rawdata',
2009 Jan 15
2
R package tests
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I was wondering if anyone could point me in the right direction for reading up on writing tests in
R. I'm writing some functions for inclusion into a package and would like to test them to ensure
they're doing what I expect them to do.
Are these approaches used for testing packages in CRAN?
Cheers,
Nathan
- --
-
2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using:
.onAttach <- function(libname, pkgname) {
.bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah")
}
.onUnload <- function(libpath) {
dbDisconnect(.bbg.db.conn)
}
which results in a hidden global variable in the global environment.
I would prefer to make the assignment only in the package namespace.
2003 Sep 17
3
Building and loading a DLL on Windows NT
I am trying to build a simple dll with Rcmd SHLIB to link into R. The
results of the build are below. From my limited knowledge of building DLLs,
it looks like it worked (I didn't get any errors).
F:\R\dlls> Rcmd SHLIB add.C
making add.d from add.C
g++ -IC:/PROGRA~1/R/src/include -Wall -O2 -c add.C -o add.o
ar cr add.a *.o
ranlib add.a
g++ --shared -s -o add.dll add.def add.a
2017 Jan 03
2
[R] Problems when trying to install and load package "rzmq"
On Tue, Jan 3, 2017 at 3:53 PM, Whit Armstrong <armstrong.whit at gmail.com> wrote:
>
> I maintian the rzmq project.
>
> love to get it running on windows, but zmq doesn't play nicely with R's
> mingw.
It's fairly easy to link against the libraries from rwinlib:
https://github.com/rwinlib/zeromq. I'll send you a pull request later
this week to fix the binary
2006 Jul 27
3
deparse(substitute(foo))
I see that plot.default uses deparse(substitute(x)) to extract the
character name of an argument and put it on the vertical axis.
Hence:
foo <- 1:10
plot( foo )
will put the label "foo" on the vertical axis.
However, for a function that takes a "..." list as an input, I can only
extract the first argument name:
x <- 1:10
y <- 10:20
foo <- function(...) {
2004 Sep 09
4
scoping rules
Can someone help me with this simple example?
sq <- function() {
y <- x^2
y
}
myfunc <- function() {
x <- 10
sq()
}
myfunc()
executing the above in R yields:
> myfunc()
Error in sq() : Object "x" not found
I understand that R's scoping rules cause it to look for "x" in the
environment in which "sq" was defined (the global environment in
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R?
Here is the bit of code that I'm having trouble with:
> test.date <- strptime("1/1/2040",format="%m/%d/%Y")
>
> unlist(test.date)
sec min hour mday mon year wday yday isdst
0 0 0 1 0 140 0 0 0
>
> date.plus.one <- as.POSIXct(test.date) +
2008 Nov 18
2
anyone familiar with this error?
[whit at linuxsvr R.packages]$ sudo R CMD INSTALL portfolio.construction
* Installing to library '/usr/local/lib64/R/library'
* Installing *source* package 'portfolio.construction' ...
** R
** preparing package for lazy loading
Loading required package: fts
Loading required package: quadprog
Loading required package: Rexcelpoi
terminate called after throwing an instance of
2008 Dec 11
2
is there a way to recursilvely lapply
for a simple example:
x <- list()
x[["a"]] <- list(a=c(1,2,3),b=c(3,4,5))
x[["b"]] <- list(a=c(6,7,8),b=c(9,10,11))
lapply(x,sum)
this fails w/
Error in FUN(X[[1L]], ...) : invalid 'type' (list) of argument
Just wondering if I have overlooked something obvious.
one can also do:
lapply(x,lapply,sum)
but that assumes that you already know how many levels
2006 Jul 26
2
RODBC on linux
Anyone out there using Linux RODBC and unixODBC to connect to a
Microsoft SQL server?
If possible can someone post a sample .odbc.ini file?
I saw a few discussions on the archives a few years ago, but no config
file details were available.
Thanks,
Whit
This e-mail message is intended only for the named recipient(s) above. It may contain confidential information. If you are not the intended
2008 Oct 28
2
color individual bar of histogram?
Anyone know a quick way to color one bar of a histogram?
I want to mark the bar in which the most recent observation falls.
So, for instance:
x <- rnorm(100)
latest.ob <- x[100]
hist(x)
## how do I mark the bucket that latest.ob falls into?
Thanks,
Whit
2004 Oct 25
1
copyright issues when package maintainer changes
I will be taking over as maintainer of the its package from Giles Heywood.
The code was originally written while he was working at Commerzbank. I have
added the header below to the top of the R source file to indicate the
changes in the copyrights for the code. The package was originally released
under GPL2. I have no experience with copyright issues, and would
appreciate it if someone who does
2017 Sep 17
2
R-devel r73293 and the testthat package
Hello,
Windows R-devel no longer lets me use testthat even though the CRAN checks are pretty much clean. I have copied my session output below.
Will
R Under development (unstable) (2017-09-16 r73293) -- "Unsuffered Consequences"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO