From mons.magnusson at gmail.com  Sun Feb  8 14:22:15 2015
From: mons.magnusson at gmail.com (=?UTF-8?Q?M=C3=A5ns_Magnusson?=)
Date: Sun, 8 Feb 2015 14:22:15 +0100
Subject: [Rd] Testthat and global environments in R packages on CRAN
Message-ID: <CAFQDYB2Vz1ysc9GJGLHZoGQaiZe+x_ZDZ3s9HJOY7vNYt6TMoQ@mail.gmail.com>

Hi!

Im currently developing an R package to automatically give students
feedback on programming assignments in R. I use the testthat package as an
engine for the unit testing and do a wrapper to make the automatic marking
easy for the students.

One function (called mark_my_file() ) will mark the students lab file using
testthat tests and a new (simple) reporter. The problem is that I need to
do the marking of the lab with an empty global environment (due to the
testthat package).

So my first thought was to:
1) store the global environement in the temporary directory as an
.Rdata-file
2) clean the global environment
3) run the tests
4) clean the global environment (from the student lab file)
5) reload the old global environment

But the problem is that it is not possible to publish packages on CRAN that
modifies the global environment.

Is there anyone that have any solutions/ideas to this problem?

The package can be found here:
https://github.com/MansMeg/markmyassignment

-- 
Kind regards

M?ns

============================
M?ns Magnusson
+46 (0) 70 588 97 15
mons.magnusson at gmail.com
============================

	[[alternative HTML version deleted]]



[Rd] Testthat and global environments in R packages on CRAN
=?UTF-8?Q?M=C3=A5ns_Magnusson?=