similar to: Dealing with ...

Displaying 20 results from an estimated 30000 matches similar to: "Dealing with ..."

2003 Oct 12
6
Rd problems
Hola! I have the following in a .Rd file: \eqn{\mbox{coef} = c(\mbox{coef}[1],\ldots, \mbox{coef}[n]) } {coef = c(coef[1], coef[2], \dots, coef[n])} However, both arguments come out in the latex file! Whats happening? Kjetil Halvorsen
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
2018 May 03
3
length of `...`
Hi, It would be great if one of the experts could comment on the difference between Hadley's dotlength and ...length? The fact that someone bothered to implement a new primitive for that when there seems to be a very simple and straightforward R-only solution suggests that there might be some gotchas/pitfalls with the R-only solution. Thanks, H. On 05/03/2018 08:34 AM, Hadley Wickham
2015 Apr 27
4
Inconsistency when naming a vector
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/
2018 Aug 25
4
Where does L come from?
Hi all, Would someone mind pointing to me to the inspiration for the use of the L suffix to mean "integer"? This is obviously hard to google for, and the R language definition (https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Constants) is silent. Hadley -- http://hadley.nz
2016 Aug 05
1
What happened to Ross Ihaka's proposal for a Common Lisp based R successor?
But you can easily fall back to R from within Julia; see http://juliastats.github.io/RCall.jl/latest/ On Aug 5, 2016 1:27 PM, "Hadley Wickham" <h.wickham at gmail.com> wrote: > No. > > Hadley > > On Fri, Aug 5, 2016 at 11:12 AM, Kenny Bell <kmbell56 at gmail.com> wrote: > > Is it conceivable that Julia could be ported to use R syntax in a way > that
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
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
2012 Apr 14
2
some questions about sympy (that is, rSymPy)
I am experimenting with rSymPy, and it seems to work nice. However, I dislike the need to wrap all sympy expressions within quotes, it leads to ugly calls like library(rSymPy) Var("x,y,z") sympy("(x+y)**2") and so on. Inspired by the function cq from mvbutiles package: library(mvbutils) > cq function (...) { as.character(sapply(as.list(match.call(expand.dots =
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
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
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
2015 Oct 13
1
A where() functions that does what exists() does but return the environment when object lives?
On Tue, Oct 13, 2015 at 4:43 PM, Hadley Wickham <h.wickham at gmail.com> wrote: > Seems easy enough to write yourself: > > where <- function(x, env = parent.frame()) { > if (identical(env, emptyenv())) > return(NULL) > if (exists(x, envir = env, inherits = FALSE)) > return(env) > where(x, parent.env(env)) > } > > sample2 <-
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
Would this return a quosure? (i.e. a single sided formula that captures both expression and environment). That's the data structure we've adopted in tidyeval as it already has some built in support. Hadley On Friday, March 17, 2017, Michael Lawrence <lawrence.michael at gene.com> wrote: > Interesting idea. Lazy and non-standard evaluation is going to happen; the > language
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: >>>
2015 Mar 30
1
Segfault with match()
I left out the warning - it's still there. The output object is malformed but either +.factor should prevent this or match() should check. Hadley On Mon, Mar 30, 2015 at 3:50 PM, William Dunlap <wdunlap at tibco.com> wrote: > Did you leave out the warning from "+", which should be an error, > as it produces an illegal ordered factor in this case and factor+factor >
2015 Jun 30
2
Defining a `show` function breaks the print-ing of S4 object -- bug or expected?
Same thing happens with S3 if you redefine print(). I thought that code was actually calculating the function to call rather than the symbol to use, but apparently not. Shouldn't be too hard to fix. luke On Tue, 30 Jun 2015, Hadley Wickham wrote: > On Tue, Jun 30, 2015 at 2:20 PM, Duncan Murdoch > <murdoch.duncan at gmail.com> wrote: >> On 30/06/2015 1:57 PM, Hadley
2003 Jul 21
3
Confidence Band for empirical distribution function
Hi, I was trying to draw an empirical distribution function with uniform confidence bands. So I tried to find a way to calculate values of the Kolmogorov-Smirnov Distribution but failed. I guess it must be hidden somewhere (since the ks-test is implemented), but I was unable to find it. Is there any way to do this? Thanks Leif Boysen
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
2015 Jun 30
2
Defining a `show` function breaks the print-ing of S4 object -- bug or expected?
On 30/06/2015 1:57 PM, Hadley Wickham wrote: > A slightly simpler formulation of the problem is: > > show <- function(...) stop("My show!") > methods::setClass("Person", slots = list(name = "character")) > methods::new("Person", name = "Tom") > #> Error in (function (...) : My show! Just to be clear: the complaint is