Re: [Rd] checking existence of active bindings
On Wednesday 28 March 2007 23:56, Tony Plate wrote: > Is there any way to check whether an active binding exists without > actually calling the active binding? I'd like to be able to do > something like exists("x", ...) and know whether "x" exists without > actually fetching its value if it is an active binding (because it could > consume significant resources to fetch the value). > > > exists("x", inherits=FALSE) > > getting x1 > [1] TRUE > As you most probably found out for yourself - this works as intended. > "x" %in% ls(globalenv()) [1] TRUE Best, Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Aggregate factor names
On Thursday 27 September 2007 (17:57:55), Mike Lawrence wrote: > ex. it is annoying to type > > with( > my.data > ,aggregate( > my.dv > ,list( > one.iv = one.iv > ,another.iv = another.iv > ,yet.another.iv = yet.another.iv > ) > ,some.function > ) > ) If you use my package 'memisc' you can write aggregate(some.function(my.dv)~one.iv+another.iv+yet.another.iv, data=my.data) Best, Martin -- "Dealing with failure is easy: work hard to improve. Success is also easy to handle: you've solved the wrong problem. Work hard to improve." fortune 1.0 - Dr. Martin Elff Dept. of Social Sciences University of Mannheim Block A5, Room A 328 (NEW) 68131 Mannheim Germany Phone: +49-621-181-2093 Fax: +49-621-181-2099 E-Mail: [EMAIL PROTECTED] Web: http://webrum.uni-mannheim.de/sowi/elff/ http://www.sowi.uni-mannheim.de/lspwivs/ - __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Small modification of zip.file.extract in utils?
On Thursday 30 October 2008 (20:08:27), Jon Olav Skoien wrote: > Dear list, > > I needed to extract a zip-archive, and found zip.file.extract in utils. > My only problem was the use of tempdir(), since I wanted to permanently > extract the archive at a fixed location for later use. My own fix was > simple, adding an extra parameter zipdir (without default), and within > the function change > tmpd <- tempdir() > to > tmpd = ifelse(missing(zipdir),tempdir(),zipdir) > > This modification could maybe be useful also for other users, unless > there are some problems I am not aware of? I had similar problems with 'zip.file.extract' and implemented a function 'unzip' in my package 'memisc', which also works in a way that is probably more comprehensible for end-users like me: unzip package:memisc R Documentation Extract Files from Zip Files Description: 'unzip' extracts a file from a zip archive and puts them into a directory specified by the user or into the temporary directory of the current session. Usage: unzip(zipfile,item, dir=tempdir(),package=NULL) Arguments: zipfile: a character string, the path to the zip file. item: a character string, full path (from the root of the zip file) to the file to extract. dir: path to the directory were to place the extracted file. package: optional package name, if given, the path to the zipfile starts in the package's root directory. Examples: # Extract American National Election Study of 1948 # It is item "NES1948.POR" in zip file "anes/NES1948.ZIP" # where this path is relative to the packages' # root directory. nes1948.por <- unzip("anes/NES1948.ZIP","NES1948.POR", package="memisc") nes1948.por All the best, Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] New package test results available
Dear Professor Ripley, as you pointed out, package 'memisc' caused a compilation error with the Sun Studio compiler because of gcc-specific compilation flags. The obvious reason was that the 'src' directory had a 'Makevars' file containing "PKGC_FLAGS="-Wall -pedantic". In the new revision of my package uploaded this weekend, the Makevars file is removed, but nevertheless according to the protocol of the automatic package checking with Sun Studio (of 2009-02-10 05:53:33), a compilation error occurs because of the gcc-specific compilation options "-Wall -pedantic". I checked the CRAN-version of the package for any instances of Makefiles or Makevar files, but none is present. Also I grepped my sources for any instance of "-Wall", with negative results. So I wonder what I should do to avoid Sun Studio errors caused by these options. Any hint is appreciated. Thanks, Martin Elff On Saturday 07 February 2009 (08:22:49), Prof Brian Ripley wrote: > We've added a column at > > http://cran.r-project.org/web/checks/check_summary.html > > of test results using the Sun Studio compiler: it is intended that > these will be updated weekly. > > The Sun Studio compiler is that used on Solaris: these runs were on > the Linux version. All the other platforms are using gcc 4, so this > provides an opportunity for checking for use of gcc-specific features > and also standards conformance (the Sun compilers have a long-time > reputation for close conformance to the language standards). > > There are known problems where packages use C++ or JNI interfaces > (e.g. rgdal and EBImage) as the libraries and JVM were compiled under > gcc's conventions (even though a Sun JVMi is used). About half the > packages using rJava segfault, which seems to a JNI issue. > > Some packages use gcc-specific compiler flags: > >LogConcDEAD Matching amap geometry memisc taskPR > > but the vast majority of the errors reported are C++ errors. One > class that may not be immediately obvious is the use of C headers in > C++: you are supposed to write e.g. > > #includd > > NOT > > #include > > Symptoms of this can be seen for packages > >BayesTree EMCC MCMCfglmm MarkedPointProcess Matching Matrix >RQuantlib RandomFields Rcpp SoPhy compHclust dpmix igraph minet >mixer modeest monomvm multic pcaPP rgenoud robfilter segclust >simecol subselec - Dr. Martin Elff Lecturer LSPWIVS (Prof. van Deth) Department of Social Sciences University of Mannheim A5, 6, A 328 68131 Mannheim Germany Phone: +49-621-181-2093 Fax: +49-621-181-2099 E-Mail: e...@sowi.uni-mannheim.de Web: http://webrum.uni-mannheim.de/sowi/elff/ http://www.sowi.uni-mannheim.de/lspwivs/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel