search for: codetools

Displaying 20 results from an estimated 149 matches for "codetools".

2011 Feb 03
1
bug in codetools/R CMD check?
...#39; are not allowed Calls: <Anonymous> ... rownames<- -> row.names<- -> row.names<-.data.frame Execution halted ----------------- yet everything is okey dokey at http://bioconductor.org/checkResults/2.7/bioc-LATEST/#S under the snpMatrix entry. I believe it might be a bug in codetools::incLocalSrcInfo (used by "R CMD check") and here is what I think the fix(?) - but I am not entirely sure what that routine does and why other package writers haven't noticed similiar problems before: diff -ur codetools/R/codetools.R codetools-fix/R/codetools.R --- codetools/R/codeto...
2013 Apr 08
4
checkUsage from codetools shows errors when function uses functions from loaded packages
...check them with checkUsage. In case these functions (loaded via source or copy pasted to the R console) use functions from other packages, I get this error: no visible global function definition for ?xxxxxxx? For example: test = function() { require(plotrix) color.legend() } library(codetools) checkUsage(test) Can I tell codetools somehow where to look for these functions without building a full blown package? Cheers Jannis
2013 Jan 16
2
Codetools Query (repost)
Sorry for reposting, i keep forgetting this should be plain text. Will not make this mistake again Hello, The following code moo <- function(a=1){ x=1; x=x+y} funs <- new.env() enter <- function(type, v, e, w){ assign(v, TRUE, funs) } library(codetools) collectUsage(moo, enterGlobal = enter) adds + to the environment funs i.e. funs: "=" "{" "+" "y" How can i ignore variables which are present in base, utils, stat environments from being added (equivalently(?) symbols present in R when R is started) I t...
2007 Jul 25
1
codetools really optional for R CMD check?
After upgrading to R 2.5.1 on Debian, R CMD check gives * checking Rd cross-references ... WARNING Error in .find.package(package, lib.loc) : there is no package called 'codetools' Execution halted * checking for missing documentation entries ... WARNING etc The NEWS file says (for 2.5.0; I was on 2.4 before the recent upgrade) o New recommended package 'codetools' by Luke Tierney provides code-analysis tools. This can optionally be used by 'R CMD che...
2007 Apr 24
2
R 2.5.0 in Debian unstable
I just uploaded R 2.5.0 to Debian's unstable distribution. As Peter's announcement says, it now contains two new packages'rcompgen' and 'codetools'. About two or three weeks ago, I also packaged these, just like other 'recommended' packages as r-cran-rcompgen and r-cran-codetools. However, as "new" packages, they are still in the NEW queue awaiting inclusion into Debian. If you find rcompgen and/or codetools lacking, I...
2003 Jul 28
0
codetools
I've put together a package codetools with some tools for examining R source code. It is available at http://www.stat.uiowa.edu/~luke/R/codetools/codetools.tar.gz It requires a reasonably current version of R-devel. The main user functions are: checkUsage, checkUsageEnv, checkUsagePackage: Examine closure, clos...
2019 May 05
3
Staged installation fail on some file systems
I'm observing that the new staged installation in R 3.6.0 can produce: mv: cannot move ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-codetools/00new/codetools? to ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/codetools?: File exists ERROR: moving to final location failed on some file systems. # EXAMPLE $ R --vanilla R version 3.6.0 (2019-04-26) -- "Planting of a Tree" Copyright (C) 2019 The R Foundation for Statistical Com...
2016 Apr 09
2
Note: no visible definition
...reached with the particular arguments > | passed to the script. If I source the script in a shell and run it I do > | not get the message. > > Guess: your shell session has an object foo. It will be referenced. > > Your Rscript, running from 'empty' never defines foo. And codetools tells > you that because more often than not it is error. Sometimes codetools gets > it wrong too, ie with you peek into data structure via evaluation tricks or > with simple with(mydataframe, columnOne). > > No, the symbol is acytually defined in a package that is not loaded when...
2010 Jan 29
1
Question on codetools and parse trees
Dear R Users, Using codetools I obtained the text representation of the parse tree for this snippet z=quote({x[1]<-2}) showTree(z) > ("{" (<- ([ x 1) 2)) (A) If I understand correctly, x[1]<-2 ought to be "[<-"(x,1,2), so shouldn't i see ("{" ( [<- x 1 2 ) ) If ind...
2009 Mar 06
0
Bug in codetools ?
Hello, Is this a bug in codetools: > codetools::showTree( body( glm) ) ("{" (<- call (match.call)) (if (is.character family) (<- family (get family "function" (parent.frame)))) (if (is.function family) (<- family(family))) (if (is.null ($ family family)) ("{" (print family) (stop &quot...
2019 May 07
2
Staged installation fail on some file systems
...path/pkg/ is empty. /Henrik > > Best > Tomas > > > On 5/5/19 4:35 AM, Henrik Bengtsson wrote: > > I'm observing that the new staged installation in R 3.6.0 can produce: > > > > mv: cannot move > > ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-codetools/00new/codetools? > > to ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/codetools?: File > > exists > > ERROR: moving to final location failed > > > > on some file systems. > > > > # EXAMPLE > > > > $ R --vanilla > > R version 3.6.0 (2019...
2023 Jun 03
3
codetools wrongly complains about lazy evaluation in S4 methods
...d global functions or variables: R I claim that it should _not_ complain, given that lazy evaluation is a really a feature of the language _and_ given that it already does not complain about the formals of functions that are not S4 methods. Having said that, it is not obvious to me what in codetools would need to change here. Any ideas? I've attached a script that creates and installs a test package and reproduces the check output by calling tools:::.check_code_usage_in_package(). Hope it gets through. Mikael -------------- next part -------------- An embedded and charset-unspecified t...
2008 Feb 28
0
tutorial on codetools
Hi the list Is there any tutorial to learn codetools ? It seems to be a very interesting pacakge, but the help gives not that much detail, and there is not that much examples provided... Christophe
2019 May 07
0
Staged installation fail on some file systems
...e not been able to reproduce but we could fall back to copy like on Windows. Best Tomas On 5/5/19 4:35 AM, Henrik Bengtsson wrote: > I'm observing that the new staged installation in R 3.6.0 can produce: > > mv: cannot move > ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-codetools/00new/codetools? > to ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/codetools?: File > exists > ERROR: moving to final location failed > > on some file systems. > > # EXAMPLE > > $ R --vanilla > R version 3.6.0 (2019-04-26) -- "Planting of a Tree" > Cop...
2019 May 09
0
Staged installation fail on some file systems
...gt; >> Best >> Tomas >> >> >> On 5/5/19 4:35 AM, Henrik Bengtsson wrote: >>> I'm observing that the new staged installation in R 3.6.0 can produce: >>> >>> mv: cannot move >>> ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-codetools/00new/codetools? >>> to ?/home/alice/R/x86_64-pc-linux-gnu-library/3.6/codetools?: File >>> exists >>> ERROR: moving to final location failed >>> >>> on some file systems. >>> >>> # EXAMPLE >>> >>> $ R --vanilla >...
2016 Apr 09
2
Note: no visible definition
Can someone explain a message of this form from an rscript execution: Note: no visible global function definition for 'foo' This happens right at the start of execution. 'foo' is only executed in a branch of an 'if' that is not reached with the particular arguments passed to the script. If I source the script in a shell and run it I do not get the message. Mick
2010 Jun 01
0
codetools: Suggestion to detect potentially unassigned variables
This is just a note/wishlist/for the record: With foo1 <- function() { res; } foo2 <- function() { for (i in c()) res <- 1; res; } foo3 <- function() { while (FALSE) res <- 1; res; } foo4 <- function() { if (FALSE) res <- 1; res; } we get: > foo1() Error in foo1() : object 'res' not found > foo2() Error in foo2() : object 'res' not
2020 May 20
1
failed check in reg-tests-1b.R
...gt; op <- options(warn = 2)# no warning, please! ?? > m1 <- methods(na.omit) ## should give (no warning): ?? > ## ?? > setClass("bla") ?? > setMethod("na.omit", "bla", function(object, ...) "na.omit(<bla>)") ?? Error: package 'codetools' was installed before R 4.0.0: please re-install it ?? Execution halted It appears to be picking up the older version of codetools from $R_LIBS; if I unset R_LIBS, then it works just fine. So I'm wondering, is it a bug, or is the user's own fault for having R_LIBS set whilst tryin...
2011 Aug 02
7
Extract names from vector according to their values
Dear helpers, I can create a vector with the priority of the packages that came with R, like this: > installed.packages()[,"Priority"]->my.vector > my.vector base boot class cluster codetools "base" "recommended" "recommended" "recommended" "recommended" compiler datasets foreign graphics grDevices "base" "base" "recommended" "base" "...
2008 Jan 01
4
access data inside package
Dear all, Happy new year! I posted a very similar question a few days ago, but probably too cluttered. Here is a tidy, minimal version: I want to make a package, with a data.frame d and a function f given below. Now, the function f needs to use the data.frame d. I could (and that's what I've done temporarily) make a local duplicate of this data.frame in the function definition,