Displaying 20 results from an estimated 10000 matches similar to: "Where does L come from?"
2018 Aug 25
2
Where does L come from?
Not that it brings closure, but there's also
https://stat.ethz.ch/pipermail/r-devel/2017-June/074462.html
Henrik
On Sat, Aug 25, 2018, 06:40 Marc Schwartz via R-devel <r-devel at r-project.org>
wrote:
> On Aug 25, 2018, at 9:26 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
> >
> > Hi all,
> >
> > Would someone mind pointing to me to the
2018 Aug 25
0
Where does L come from?
I always thought it meant "Long" (I'm assuming R's integers are long
integers in C sense (iirrc one can declare 'long x', and it being common to
refer to integers as "longs" in the same way we use "doubles" to mean
double precision floating point). But pure speculation on my part, so I'm
curious!
On Sat, Aug 25, 2018 at 6:50 AM Henrik Bengtsson
2010 Aug 24
2
Comparing/diffing strings
Hi all,
all.equal is generally very useful when you want to find the
differences between two objects. It breaks down however, when you
have two long strings to compare:
> all.equal(a, b)
[1] "1 string mismatch"
Does any one know of any good text diffing tools implemented in R?
Thanks,
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice
2007 Feb 25
8
Double-banger function names: preferences and suggestions
What do you prefer/recommend for double-banger function names:
1 scale.colour
2 scale_colour
3 scaleColour
1 is more R-like, but conflicts with S3. 2 is a modern version of
number 1, but not many packages use it. Number 3 is more java-like.
(I like number 2 best)
Any suggestions?
Thanks,
Hadley
2018 Jun 08
6
Subsetting the "ROW"s of an object
Hi all,
Is there a better to way to subset the ROWs (in the sense of NROW) of
an vector, matrix, data frame or array than this?
subset_ROW <- function(x, i) {
nd <- length(dim(x))
if (nd <= 1L) {
x[i]
} else {
dims <- rep(list(quote(expr = )), nd - 1L)
do.call(`[`, c(list(quote(x), quote(i)), dims, list(drop = FALSE)))
}
}
subset_ROW(1:10, 4:6)
#> [1] 4 5 6
2011 Oct 18
9
readRDS and saveRDS
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://had.co.nz/
2018 Jun 08
3
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 1:49 PM, Hadley Wickham <h.wickham at gmail.com> wrote:
>
> Hmmm, yes, there must be some special case in the C code to avoid
> recycling a length-1 logical vector:
Here is a version that (I think) handles Herve's issue of arrays having one or more 0 dimensions.
subset_ROW <-
function(x,i)
{
dims <- dim(x)
index_list <-
2010 Feb 08
5
Fast way to determine number of lines in a file
Hi all,
Is there a fast way to determine the number of lines in a file? I'm
looking for something like count.lines analogous to count.fields.
Hadley
--
http://had.co.nz/
2016 Aug 05
2
What happened to Ross Ihaka's proposal for a Common Lisp based R successor?
Is it conceivable that Julia could be ported to use R syntax in a way that
would allow the vastly larger numbers of R programmers to seamlessly
switch? Or equivalently, could an iteration of R itself do this?
On Fri, Aug 5, 2016, 9:00 AM Hadley Wickham <h.wickham at gmail.com> wrote:
> When it was being actively worked on, it had the advantage of existing.
>
> Hadley
>
> On
2018 Jun 08
4
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 11:52 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
>
> On Fri, Jun 8, 2018 at 11:38 AM, Berry, Charles <ccberry at ucsd.edu> wrote:
>>
>>
>>> On Jun 8, 2018, at 10:37 AM, Herv? Pag?s <hpages at fredhutch.org> wrote:
>>>
>>> Also the TRUEs cause problems if some dimensions are 0:
>>>
2010 Jan 26
5
Strange tick in ggplot geom_area; and ordering, again
In the area plots below, I see 4 triangle ticks at both sides of the bar; I
believe these are non-stacked values for p, but they are definitively
confusing.
In addition, I would like to get the order of the colors in the plot the
same as in the legend, and not arranged alphabetically (the factor is
ordered, don't touch my order). Hadley once mentioned an undocumented
aestetics
2004 Oct 07
5
Subset doesn't drop unused factor levels
a <- data.frame(b = rep(1:5, each=2), c=factor(rep("a",10), levels=c("a","b")))
levels(subset(a, b=1, drop=T)$c)
# [1] "a" "b"
Is this a bug?
Thanks,,
Hadley
2015 Mar 30
3
Segfault with match()
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/
2010 Mar 10
2
ggplot2: "varwidth"-equivalent for geom_boxplot?
Hi,
Is there such a thing? If no: is it easily simulated?
thanks, Joh
2018 Jul 07
6
Testing for vectors
On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker <becker.gabe at gene.com> wrote:
> Hadley,
>
>>
>> I was thinking primarily of completing the set of is.matrix() and
>> is.array(), or generally, how do you say: is `x` a 1d dimensional
>> thing?
>
>
> Can you clarify what you mean by dimensionality sense and specifically 1d
> here?
What do we call a
2006 Mar 07
3
Making an S3 object act like a data.frame
"[.ggobiDataset" <- function(x, ..., drop=FALSE) {
x <- as.data.frame(x)
NextMethod("[", x)
}
"[[.ggobiDataset" <- function(x, ..., drop=FALSE) {
x <- as.data.frame(x)
NextMethod("[[", x)
}
"$.ggobiDataset" <- function(x, ..., drop=FALSE) {
x <- as.data.frame(x)
NextMethod("$", x)
}
> class(x)
[1]
2016 Mar 01
2
Data frame printing buglet when multiple empty column names
This is admittedly minor, and you shouldn't have repeated names in a
data frame anyway, but:
df <- data.frame(1:3, 1:3, 1:3)
# Ok
setNames(df, c("x", "y", ""))
# Not ok
setNames(df, c("x", "", ""))
Hadley
--
http://hadley.nz
2008 Aug 29
3
Density estimates in modelling framework
Hi all,
Do any packages implement density estimation in a modelling framework?
I want to be able to do something like:
dmodel <- density(~ a + b, data = mydata)
predict(dmodel, newdata)
This isn't how sm or KernSmooth or base density estimation works. Are
there other packages that do density estimation? Or is there some
reason that this is a bad idea.
Hadley
--
http://had.co.nz/
2005 Mar 17
3
how to close trellis.device?
Dear All:
I need draw some figure through trellis.device and save them as pdf files. How can I close trellis.device (something like dev.off() in nonlattice figure)?
Many thanks
Zhongming Yang
---------------------------------
[[alternative HTML version deleted]]
2018 Jun 08
2
Subsetting the "ROW"s of an object
I suspect this will have suboptimal performance since the TRUEs will
get recycled. (Maybe there is, or could be, ALTREP, support for
recycling)
Hadley
On Fri, Jun 8, 2018 at 10:16 AM, Berry, Charles <ccberry at ucsd.edu> wrote:
>
>
>> On Jun 8, 2018, at 8:45 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
>>
>> Hi all,
>>
>> Is there a better to