> But now if I do Depends: Rcpp or Imports: Rcpp for the sole purpose of this
> LinkingTo mechanism, I'm getting
>
> * checking dependencies in R code ... NOTE
> Namespace in Imports field not imported from: ‘Rcpp’
> All declared Imports should be used.
> See the information on DESCRIPTION files
> Would "Suggests" not work in this situation? I don't understand why you
> would need Depends. In what sense do you rely on the data only package?
Because I want someone who downloads the package to be able to run the
examples without having to take additional action.
Hadley
--
http://had.co.
> I don't know whether the author of that note would consider it spurious or
> not. A simple workaround for you (as the author of hflights) is to put a
> function into the namespace. For example, get_hflights(), that gets a copy
> of the data:
>
> get_hflights <- function() {
> data("hflights"
> Just to be clear, I distinguish the "batteries included" situation from the
> "spare batteries included" situation. I think it should be possible to
> automatically load everything that is really needed, that is why I think the
> Bayesian database is a more important case. But it strikes me as ba
> The Writing R Extensions manual says that Suggests is for packages which
> are required only for examples, which I believe matches Hadley's original
> question.
Yes, but without this package they won't be able to run the majority
of examples, which I think delivers a poor experience to the user.
Could you pass the environment and then look for the object called ... in it?
f <- function(...) {
.Call("my_fun", environment())
}
I think (and may well be wrong) that you can use standard tools to
find the DOTSXP object in that environment.
Hadley
On Thu, Dec 12, 2013 at 2:32 PM, Romain Fr
>> It would have those benefits, but it would be harder to prototype
>> changes by actually replacing the `if` function. Implementations that
>> want to optimize the calls have other ways to do it, e.g. the sorts of
>> things the compiler does.
>>
>
> Does anyone actually prototype changes to the
> Finally, for your specific use case, see also ?withCallingHandlers which
> can not only detect warnings, but also set callback functions which can
> decide whether to abort or process and restart when a warning is thrown.
> The documentation for that function is a little rough, though you can see
I'd recommend sending a reproducible example to the maintainer of the
RSQLite package (cc'd in case he doesn't follow r-devel any more)
Hadley
On Mon, Dec 30, 2013 at 7:06 PM, Sachko Honda
wrote:
> Dear fellows,
>
> I'm getting blue screen on XP while populating SQLite database, using
> RStudio a
On Thu, Jan 2, 2014 at 7:16 PM, Henrik Bengtsson wrote:
> Does it make sense to talk about the class of the output of
> substitute(...)? I'm puzzled by the following outputs:
>
> ee <- list(
> A = substitute( a <- 1 ),
> B = substitute({ a <- 1 }),
> C = substitute(( a <- 1 )),
> D = subs
It's a bit of a simplification, reference classes are wrappers around
environments. So if modifying a value in an environment would create
a copy, then modifying the same value in a reference class will also
create a copy.
The situation with modifying a vector is a bit complicated as it will
some
>> Even if you are using a developer mode, sourcing an R file will have no
>> effect on a) the shared object library (DLL/so/dylib) available in the R
>> session, nor which shared objects are associated with the package. There
>> are ways to unload shared libraries within an R session, but personal
If you're using roxygen2, you can use @example tag to include an
external file into the examples.
Hadley
On Sat, Jan 18, 2014 at 7:18 AM, Alexey Sergushichev
wrote:
> 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
in both the examples and in a special testthat
file.
Hadley
On Mon, Jan 20, 2014 at 3:32 AM, Alexey Sergushichev
wrote:
> Yes, this may work, but this way I have to have one test per file,
> which is not very convenient.
>
> ---
> Alexey
>
>
> On Sat, Jan 18, 2014 at 7:43 P
On Sun, Jan 19, 2014 at 3:16 PM, peter dalgaard wrote:
> It's not formals() that is doing you in. Rather, it is a conspiration between
> two things:
> (a) R always displays complex constants as x+yi, even if x is zero and (b)
> there really is no way to specify complex constants with non-zero r
>> It is up to you to set a default mirror: we have little idea where you
>> live (and it may not be where your email address suggests). Geolocation
>> of mirrors had been mooted but not implemented (and in a corporate
>> setting is not 100% reliable). The whole point of mirrors is to spread
>> t
You also need to make sure that your knitr vignettes include
%\VignetteEngine{knitr::knitr}
See http://yihui.name/knitr/demo/vignette/ for full details.
Hadley
On Thu, Feb 20, 2014 at 8:56 AM, baptiste auguie
wrote:
> Hi,
>
> You should take the following steps: 1) upgrade R, 2) specify
> Vig
>>> * checking CRAN incoming feasibility ... NOTE
>>> Maintainer: 'firstname A B lastname '
>
>
> This is just a Note that reminds CRAN maintainers to check that the
> submission comes actually from his maintainer and not anybody else.
How does CRAN do that? Seems like a challenging problem given
> What would be more useful in terms of reproducibility is the capability of
> installing a specific version of a package from a repository using
> install.packages(), which would require archiving older versions in a
> coordinated fashion. I know CRAN archives old versions, but I am not aware
> if
> I use Rscript, and I expect most others do too, but I was wrong about how
> long this went unreported. Martin Morgan reported it in February in R-devel
> and I didn't notice. He even gave a link to it in a message in March on
> another topic; I replied to the March message, but didn't follow th
> Strictly speaking, I don't think this is true. If it were, it would not have
> been necessary to make the change so that it does now fallback to using
> character/factor. It may, however, have always been the intent.
>
> I don't really think a warning is necessary, but there are some surprises:
>
Is there a reason it's a factor and not a string? A string would seem to be
more appropriate to me (given that we know it's a number that can't be
represented exactly by R)
Hadley
On Saturday, April 26, 2014, Martin Maechler
wrote:
> > Simon Urbanek >
> > on Sat, 19 Apr 2014 13:06:1
This is not really a question for r-devel, but basically you should use
saveRDS/readRDS rather than save/load.
Hadley
On Wednesday, April 30, 2014, Kamal wrote:
> Hi,
>
> I have a problem in renaming R object and saving them within a loop. For
> ex:
>
> for (i in 1:length(all_files))
>
>> I realize that the new message is only a warning but it is a minor
>> nuisance. Would it be possible to add an
>> option(partialMatch=TRUE) ## default is FALSE
>> or something similar to suppress that behavior? That should keep both
>> camps happy.
>
>
> I'd be much happier with
On Thu, May 1, 2014 at 4:08 PM, Kevin Ushey wrote:
> Henrik,
>
> If I understand correctly, you want something along the lines of
> (following your example):
>
> foo <- function(expr) {
> if (!is.language(expr)) substitute(expr)
> else expr
> }
>
> ## first example
> ex
Can anyone tell me what the significance of 1954 is in R's NA?
Thanks!
Hadley
--
http://had.co.nz/
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Thanks Luke!
Hadley
On Sat, May 3, 2014 at 11:48 AM, wrote:
> Hint: Ross will be 60 this year.
>
> luke
>
>
> On Sat, 3 May 2014, Hadley Wickham wrote:
>
>> Can anyone tell me what the significance of 1954 is in R's NA?
>>
>> Thanks!
>>
>>
>> BTW, that %in% has precedence over arithmetic operations is surprising,
>> error-prone, and doesn't cover any reasonable use case (who needs to
>> multiply the logical vector returned by %in% by some value?) but that's
>> another story:
>
> The point here is that the %foo% operators all have the
> I am intending to use Sweave. I have read the Sweave documentation and
> section 1.4 of the extensions manual and apart from (a) do not use split =
> TRUE (b) and include all the source components, there does not seem to be
> anything CRAN specific.
I'd strongly recommend using knitr instead - t
> Even more important than choosing between whatever(...)
> or foo::whatever(...), you should import that function
> from the foo package by putting
>
> importFrom(foo, whatever)
>
> or
>
> import(foo)
>
> in your NAMESPACE file.
>
> The 1st form also kind of document what function comes from w
> There is at least one subtle consequence to keep in mind when doing
> this. Of course, whatever choice you make, if the whatever() function
> moves to a different package, this breaks your package.
> However, if you explicitly import the function, your package will
> break at load-time (which is
> Finally, now that the use of a NAMESPACE became mandatory (well, this
> happened a few years ago), advocating systematic use of foo::whatever()
> without explicitly importing the function sounds a little bit like an
> heroic act of resistance ;-)
I don't think that's at all true - for most other
> When you provide a method for a generic function imported from another
> package then the generic must be on the search path. Otherwise if a user
> types "filter" the dispatch to "filter.test" will never occur.
Right, and this is as desired. If dplyr is not explicitly loaded by
the user, filter.
On Tue, Aug 19, 2014 at 8:28 AM, Richard Cotton wrote:
> I recently tried to submit a package to CRAN using the release
> function in the devtools package and got the response:
>
>> The policies asked you to use the webform: do so in future.
>
> I think that the relevant line in the policies are:
> I think I'm seeing the Rcaptcha package on the horizon ...
Devtools actually makes you perform a cognitively challenge set of
tasks before submitting. One of them is:
Have you read and do you agree to the the CRAN policies?
(http://cran.r-project.org/web/packages/policies.html)
1: No way
2: No
This is one of the perils of non-standard evaluation - functions are
no longer referentially transparent.
Hadley
On Mon, Aug 25, 2014 at 9:27 AM, Joris Meys wrote:
> Dear all,
>
> I initially ran into this problem while rebuilding a package dependent on
> nleqslv. I got the following error:
>
>
> I think the right answer _is_ to export the lazy data; the question is how to
> do it. There's nothing particularly strange about exporting non-functions
> ("letters" would be an example, save for the special status of package:base).
> If you attach the package, the lazyloaded data appear in t
On Wed, Aug 27, 2014 at 12:51 PM, Michael Friendly wrote:
> On 8/27/2014 10:41 AM, peter dalgaard wrote:
>>
>> Using data() in a package with lazyloaded data seems like asking for
>> trouble to me. But you're making me curious (and I'm too lazy[*] to set up
>> for rebuilding the package myself):
>
> Is that the cause of these NOTEs? Is the expectation that if I am using a
> function from a package, even a package that I have in Depends:, that I
> have to explicitly declare these imports in NAMESPACE?
Yes.
(Otherwise your package won't work if it's only attached and not
loaded. i.e. if some
On Wed, Aug 27, 2014 at 5:01 PM, Gavin Simpson wrote:
>
> On 27 August 2014 15:24, Hadley Wickham wrote:
>>
>> > Is that the cause of these NOTEs? Is the expectation that if I am using
>> > a
>> > function from a package, even a package that I have in D
>>> I'd say: Depends is a historical artefact from ye old days before
>>> package namespaces. Apart from depending on a specific version of R,
>>> you should basically never use depends. (The one exception is, as
>>> mentioned in R-exts, if you're writing something like latticeExtras
>>> that does
On Fri, Sep 12, 2014 at 3:13 PM, Paul Gilbert wrote:
>
> I am trying to follow directions at
> http://cran.r-project.org/doc/manuals/r-patched/R-exts.html#Suggested-packages
> regarding handling suggested packages with requireNamespace() rather than
> require(), and I have some questions.
>
> 1/ W
And maybe turning warnings into errors should be the default for --as-cran?
Hadley
On Sun, Oct 12, 2014 at 12:11 AM, Scott Kostyshak
wrote:
> Hi,
>
> I am using a local patch to have CMD check exit with error if there is
> a note or warning. Am I missing an already existing way to do this?
>
> I
>> Is this expected behavior? I can't seem to find anything in the help
>> for identical that relates to this.
>>
> It's not in ?identical, but ?Paren gives you some pointers.
> str(quote((a))) and str(quote({a})) are also informative.
Yes, looks like srcrefs are to blame:
x <- quote({ a })
y <-
I believe this is by design (and changed relatively recently). FALSE and
TRUE are singletons, like NULL.
Hadley.
On Friday, October 31, 2014, Jeroen Ooms wrote:
> Is it expected that attributes set on a LGLSXP created by
> ScalarLogical will apply to all future objects created by
> ScalarLogica
>> | However, it seems some of the codes in the BH package
>> | might. At any rate, when I include some boost headers such as
>> | boost/math/distributions/ through BH, I get the following warnings
>> | when submitting to the win-builder page:
>> |
>> |
>> |Found '_ZSt4cerr', possibly from '
>> And if yes how to do it best? What is the standard procedure here?
>> Should I include base package authors as contributors in DESCRIPTION???
>>
>> Am I allowed to use MIT + file license with that or is it wrong to do so?
>
> No, you must use the GPL, since the code you copied is licensed under
> Theoretically you could ask the copyright holder of that piece of code
> whether he/she/it allows you to use a different license. This brings up
> another question: who is formally the copyright holder of the R source code
> (and documentation)? The R Foundation, the individual who contributed th
> Yes, that's right. We often enter lines like
>
> Copyright (C) 1997--2014 The R Core Team
>
> into the sources, but I suspect that those don't legally imply a copyright
> transfer, at least where I live.
It's also not clear that R Core Team is a legal entity that can own copyright.
Hadley
--
> Generally the idea is that the class should be stripped because R has no
> way of knowing if the new object, for example unique(obj), still has the
> necessary properties to be considered to be of the same class as obj.
> Only the author of the class knows that. S4 would help a bit here, but
> o
You can try devtools::run_examples(test = TRUE) (assuming your
working directory is the top-level package directory)
Hadley
On Wed, Nov 26, 2014 at 12:45 PM, Paul Gilbert wrote:
> Is there a good strategy for testing examples which should not be run by
> default? For instance, I have examples w
> I'm would perhaps not go as far as calling them dangerous, but non-ASCII
> characters in code are a mixed blessing which personally I'd opt to not
> have, on balance. Being German I can understand that people may want
> umlauted characters in their variable names, but where this catches on,
> it'
I think this is bug in R CMD check code. I get a similar error:
rule: possible error in paste0(...): ... used in a situation where it
does not exist
for the simple:
rule <- function(..., pad = "-") {
if (nargs() == 0) {
title <- ""
} else {
title <- paste0(...)
}
width <- getO
I'd strongly second the notion of using github. The biggest advantage
is that others can easily contribute changes through pull requests
which lifts much of the burden from your shoulders.
Hadley
On Fri, Jan 23, 2015 at 3:49 AM, Luca Braglia wrote:
> Hi Willem
>
> thanks for volounteering.
>
> T
If it was any other environment than the global, you could use substitute:
e <- new.env()
delayedAssign("foo", stop("Hey!"), assign.env = e)
substitute(foo, e)
delayedAssign("foo", stop("Hey!"))
substitute(foo)
Hadley
On Mon, Jan 26, 2015 at 12:53 PM, Henrik Bengtsson
wrote:
> Hi, I got an in
On Tue, Jan 27, 2015 at 8:56 AM, Martin Maechler
wrote:
>>>>>> Henrik Bengtsson
>>>>>> on Mon, 26 Jan 2015 12:41:48 -0800 writes:
>
> > On Mon, Jan 26, 2015 at 12:24 PM, Hadley Wickham
> wrote:
> >> If it was any other
On Thu, Jan 29, 2015 at 7:57 AM, John Chambers wrote:
>
> On Jan 28, 2015, at 6:37 PM, Michael Lawrence
> wrote:
>
>> At this point I would just due:
>>
>> formals(body(method)[[2L]])
>>
>> At some point we need to figure out what to do with this .local() confusion.
>
> Agreed, definitely. The
> Yea, but it is super weird that as.list() filters elements out of the
> environment during coercion.
>
> I think I'm going to look through the uses of ls() inside of the core
> packages, because I suspect that is usually not necessary to extract the
> keys, and there is a cleaner (and probably fa
Would it be possible to turn as.factor into an S3 generic? It seems to
be one of the few coercion methods that aren't already generic.
Hadley
--
http://had.co.nz/
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
do.call(sna::snaFunName, args = args)
?
Hadley
On Tue, Feb 24, 2015 at 1:29 PM, Skye Bender-deMoll
wrote:
> Dear R-devel
>
> I have a function in a package that essentially provides a wrapper for a
> group of functions in another Suggested package (it sets appropriate
> defaults for the context
That makes sense to me.
Hadley
On Mon, Mar 2, 2015 at 8:45 AM, Therneau, Terry M., Ph.D.
wrote:
> User of the coxme library (mixed effects Cox models) are instructed to use
> ranef(), fixed(), VarCorr(), etc to retrieve bits out of a fitted model; it
> purposely uses the same methods as nlme and/
How about just nlme::ergoStool ?
Hadley
On Mon, Mar 2, 2015 at 4:48 PM, Therneau, Terry M., Ph.D.
wrote:
> I've moved nlme from Depends to Imports in my coxme package. However, a few
> of the examples for lmekin use one of the data sets from nlme. This is on
> purpose, to show how the results a
This is admittedly a contrived example, but...
data(housing, package ="MASS")
x <- housing$Type + housing$Sat
match(x, unique(x))
Hadley
--
http://had.co.nz/
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
e:
> Incompatible methods ("Ops.factor", "Ops.ordered") for "+"
>> str(x) # 2 levels, so integer codes of 3 is illegal
> ordered[1:2] w/ 2 levels B
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Mon, Mar 30, 2015 at 1:10 PM, H
Sometimes the absence of a name is maked by an NA:
x <- 1:2
names(x)[[1]] <- "a"
names(x)
# [1] "a" NA
Whereas other times its
y <- c(a = 1, 2)
names(y)
# [1] "a" ""
Is this deliberate? The help for names() is a bit murky, but an
example shows the NA behaviour.
Hadley
--
http://had.co.nz/
_
> install.packages("plyr", quiet = T)
trying URL
'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.2/plyr_1.8.2.tgz'
Content type 'application/x-gzip' length 855795 bytes (835 KB)
==
downloaded 835 KB
The downloaded binary packages are in
/t
On Mon, Apr 27, 2015 at 8:33 AM, peter dalgaard wrote:
>
>> On 27 Apr 2015, at 13:48 , Hadley Wickham wrote:
>>
>> Sometimes the absence of a name is maked by an NA:
>>
>> x <- 1:2
>> names(x)[[1]] <- "a"
>> names(x)
>> # [1] &qu
mkdir "A&"
R
# install.packages("pkgKitten")
pkgKitten::kitten("aPackage", "A&")
q()
R CMD INSTALL "A&"
gives
Warning invalid package A
(not the absence of the ampersand)
I'm reasonably certain this is a bug - I don't think ampersands should
require any additional escaping when already double qu
Did you export the S3 methods in the NAMESPACE?
Hadley
On Mon, May 4, 2015 at 7:52 AM, wrote:
> Hello
>
> I tried to define replacement functions for the class "mylist". When I test
> them in an active R session, they work -- however, when I put them into a
> package, they don't. Why and how
On Mon, May 4, 2015 at 12:06 PM, wrote:
> No. I fixed that, the NAMESPACE file now contains:
>
> S3method("[[<-", mylist)
> S3method("$<-", mylist)
>
> It still does not work. I also created a print method (print.mylist) which
> did work out of the box, regardless of being in the NAMESPACE file
Make the example print out Sys.getenv() and then manually inspect?
Otherwise, you'll need to debug the code by adding print statements.
Something clearly is not as you expect, so you need carefully
empirically verify your assumptions about the inputs to and
environment of the function.
Hadley
On
Hi all,
Is there any chance that readRDS and saveRDS might one day become
read.rds and write.rds? That would make them more consistent with the
other reading and writing functions.
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://ha
>> Is there any chance that readRDS and saveRDS might one day become
>> read.rds and write.rds? That would make them more consistent with the
>> other reading and writing functions.
>
> Ending names in .foo is a bad idea because of the S3 naming conventions, so
> I think this is unlikely. But you
>> Ending names in .foo is a bad idea because of the S3 naming conventions, so
>> I think this is unlikely. But you can always create an alias yourself...
>
> I always thought that S3 was part of the reason for read.ext write.ext. In:
>
> "/path/file.ext"
>
> the "class" of the file is "ext". I k
> My package will have an update soon, that is not backward compatible
> with the current version. It will likely break much of the existing
> code. Many (~50) packages depend on 'igraph' and they, too, will most
> probably break with the new version.
>
> My intended solution is, that I create a s
> We did have an attempt at that for some versions, but I don't think it ever
> achieved all of its goals, and we've dropped it.
Yes, I remembered it used to be possible to do versioned installs, but
I don't think you could ever have them loaded simultaneously.
> I'm not sure it would be "optimal
> Please, no! We don't want to enter the realm of the computer assuming it
> knows what you want to do (which is becoming too common nowadays,
> unfortunately, making the interaction more and more annoying). For some users
> this error simply means that they mistyped the package name, so fetchin
Currently help(package = S4) looks like:
coef-methodsMethods for Function 'coef' in Package 'stats4'
confint-methods Methods for Function 'confint' in Package
'stats4'
logLik-methods Methods for Function 'logLik' in Package
> I agree that it is non-trivial to solve the cases you & I have posed.
> However, I would wholeheartedly support having an error spit back for any
> function that does not explicitly support a class. In this case, if I
> attempt to do sapply(x, class), and 'x' is of class "difftime", then I
> How CRAN behaves and how the help package system behaves may be two
> different problems. My question is specifically on how CRAN works.
>
> To have inst/doc/ documents to be listed on the package's help page,
> you can add an inst/doc/index.html file, cf. Section 'Writing package
> vignettes' i
Could whoever is in charge of the next DSC contact me? We might be
able to co-host it with interface in Houston, May 16-18 2012.
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
___
Hi all,
I'd like to discuss a infelicity/possible bug with gsub. Take the
following function:
f <- function(x) {
gsub("\u{A0}", " ", gsub(" ", "\u{A0}", x))
}
As you might expect, in utf-8 locales it is idempotent:
Sys.setlocale("LC_ALL", "UTF-8")
f("x y")
# [1] "x y"
But in the C locale it
It'd be cool if R CMD was user extensible through packages, so that (e.g.)
R CMD mypackage::mycommand
would do something like:
path <- system.file("cmd", paste(command, ".r"), package = package)
if (!file.exists(path)) {
stop("Command ", command, " in ", package, " does not exist")
} else {
> That does seem to mix up namespaces quite a bit.
That was just a proposal - equally
R CMD mypackage::mycommand
could just run
mypackage::mycommand()
but then passing argument might get a bit confusing.
> But what does it get you
> that "Rscript -e" doesn't already give you? You can set up
> The shell command
> R CMD something
> currently acts as though it puts R_HOME/bin on the front
> of PATH, looks for an executable file called 'something'
> in PATH, and then executes it. The executable may call R
> or it may not.
>
> I think that running an R script file is sufficiently differe
Hi all,
I think I've spotted a small bug in URLencode: + is not listed as a
reserved character (and hence not percent encoded) even though it is
listed as a reserved character in rfc3986
(http://tools.ietf.org/html/rfc3986#section-2.2). The documentation
for URLencode cites rfc1738, which rfc3986
> Actually this is the situation I was facing when I did my first post:
> I have a function that downloads a list of sequences from the Ensembl
> FTP server, sorts them by name, and returns them to the user. I have
> a test for that function and the test was working for me when I was
> doing
>
> t
This is also something I'd appreciate for the devtools package.
Hadley
On Fri, Dec 16, 2011 at 7:36 AM, Daniel Adler wrote:
> Dear R Core Team,
>
> I have a question related to the programming interface for namespace object
> creation at run-time.
>
> This is something that I need in the rdyncal
Hi all,
I frequently find that I've failed to export something in my NAMESPACE
and hence my package doesn't work when it's imported into another
package. Does anyone have suggestion for debugging this type of
problem? R CMD check passes without any ns related errors on both the
importee and the i
ied to an object of
class "NULL"
> library(ggplot2)
> my_plot()
# Plot appears.
Hadley
On Fri, Dec 23, 2011 at 1:50 PM, Hadley Wickham wrote:
> Hi all,
>
> I frequently find that I've failed to export something in my NAMESPACE
> and hence my package doesn't work w
3e <- paste(ns$S3methods[, 1], ns$S3methods[, 2], sep = ".")
f <- ls("package:ggplot2")
s3 <- f[str_detect(f, fixed("."))]
missing <- setdiff(s3, s3e)
missing[!str_detect(missing, "bolus|icon")]
(Code isn't reproducible, but should
>> in scales_add_defaults, where the symbol isn't found in the globalenv()
>> when nstest is attached and ggplot2 only loaded, but is (via the search
>> path) when ggplot2 is attached.
>
> and topenv(parent.frame()) is a replacement that gets to .GlobalEnv for
> ggplot2, and to the name space for n
Hi all,
There seems to be rather a large speed disparity in subsetting when
working with a whole data frame vs. working with just columns
individually:
df <- as.data.frame(replicate(10, runif(1e5)))
ord <- order(df[[1]])
system.time(df[ord, ])
# user system elapsed
# 0.043 0.007 0.059
sy
sts is always faster since you
> get to the fast internal code.
>
> Cheers,
> S
>
>
> On Dec 28, 2011, at 10:37 AM, Hadley Wickham wrote:
>
>> Hi all,
>>
>> There seems to be rather a large speed disparity in subsetting when
>> working with a whole
> Attributes are slightly harder to work with, so Simon's recommendation is
> good advice. But in cases where you want other functions to work with the
> result, and the result isn't a named list with a class, then attributes are
> a convenient way to go.
>
> The only two snags I can think of are
Hi all,
A couple of ideas for improving seq_along:
* It would be really useful to have a second argument dim:
seq_along(mtcars, 1)
seq_along(mtcars, 2)
# equivalent to
seq_len(dim(mtcars)[1])
seq_len(dim(mtcars)[2])
I often find myself wanting to iterate over the rows or c
> I don't see the benefit of seq_along(mtcars, 1) versus seq_len(nrow(df)) in
> readability.
I like it because:
* it reads nicely: I want a sequence along this structure in that direction
* it's more consistent: for(i in seq_along(x)) -> for(row in
seq_along(mtcars, 1))
* it generalised in a stra
> well put! I would add, though, that t() generalizes to aperm(),
> and the magic package contains arev() which is a generalization
> of rev().
There are the flip operators of matlab, and rotating matrices/array by
multiples of 90 degrees.
> I'm always on the lookout for other array functional
On Fri, Jan 27, 2012 at 3:47 AM, Mark Cowley wrote:
> Dear list,
> I'm hoping the R guru's can help with an error i've been getting for at least
> a year during active package development.
>
> I have a package loaded & spot a documentation bug, so I:
> edit the Rd file (or in the roxygen header +
On Sat, Feb 4, 2012 at 10:38 AM, Martin Maechler
wrote:
> The help has
>
>> Description:
>
>> 'nrow' and 'ncol' return the number of rows or columns present in 'x'.
>> 'NCOL' and 'NROW' do the same treating a vector as 1-column matrix.
>
> and
>
>> x: a vector, array or data frame
>
> I'm pr
301 - 400 of 774 matches
Mail list logo