similar to: How to build a list with missing values? What is missing, anyway?

Displaying 20 results from an estimated 1000 matches similar to: "How to build a list with missing values? What is missing, anyway?"

2012 Oct 23
4
[LLVMdev] Here need your help
Hi all when i compiled llvm-3.0 with icedtea1.11.4 together,A memory_barrier error happened ,And now I write to all of you for the following questions need your help and suggestion : 1, Is any function which can replace the "make_function" in the following function, 2 , Or is there any different paramters in make_function with the similar action with the following one
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with coming up with a way to improve the ocaml binding's type safety. We can't go letting haskell beat us now, can we? I think I got an easy solution with phantom types. For those who don't know what the problem is, the ocaml bindings share one type between whole class branches (like values). This means we need to downcast
2010 Aug 02
1
Convert an expression to a function
Hi John, Here is my code practicing. Please give me some advises. Thank you. Wu Gong # Extract the function string f.str <- sub("y~","",exprtext) # Get arglist from the text sp1 <- paste("\\",c(getGroupMembers(Arith),"(",")"),sep="") sp2 <- getGroupMembers(Math) sps <-
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
Hi Erick, On 2008-03-15, at 04:03, Erick Tryzelaar wrote: > I was talking to Gordon on #llvm earlier, and he challenged me with > coming up with a way to improve the ocaml binding's type safety. I > think I got an easy solution with phantom types. This could be a good step. I'm not sure I can predict all of the implications; I'd suggest you work up a proof of concept.
2013 Jan 23
1
Arguments passing through dot-dot-dot lose ability to check for missing()?
Hi R-devel. Is the following behavior in g1() and h1() expected? It seems to make "..." arguments work slightly differently from named arguments. #missing() has the property that it looks "up the chain" #for example, "z" can be missing in f3 even if #that argument did have a name ("y") in f2 f1 <- function(x, ...) { cat("In f1, missing(x) is
2010 Jul 27
1
problem with zero-weighted observations in predict.lm?
In modelling functions some people like to use a weight of 0 to drop an observation instead of using a subset value of FALSE. E.g., weights=c(0,1,1,...) instead of subset=c(FALSE, TRUE, TRUE, ...) to drop the first observation. lm() and summary.lm() appear to treat these in the same way, decrementing the number of degrees of freedom for each dropped observation. However, predict.lm() does
2016 Oct 19
2
How to assign NULL value to pairlist element while keeping it a pairlist?
On Sat, Oct 15, 2016 at 2:00 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>>> on Wed, 12 Oct 2016 15:21:13 -0700 writes: > > > Thanks, this was what I expected. There is a desire to > > eliminate the usage of pairlist from user code, which > >
2019 Jun 04
2
[PATCH libnbd] generator: Fix race condition when validating h->state.
The code for (eg) nbd_aio_pread starts by checking this outside the lock: if (!(nbd_aio_is_ready (h) || nbd_aio_is_processing (h))) { However there can still be a race condition even though h->state is atomic: Thread A Thread B (in a call that holds h->lock) (calling nbd_aio_pread) --------------------------------------------------------------------
2008 Mar 15
3
[LLVMdev] improving the ocaml binding's type safety
So just to compare, here are two different typesafe phantom type implementations. One is bottom down, the other bottom up. This is an example of the following functions: string Value::getName() bool Constant::isNull() bool GlobalValue::isDeclaration() bool GlobalVariable::isGlobalConstant() bool Function::isVarArg() Driver code: val make_constant : unit -> llconstant t val
1999 Mar 29
3
problems with formals and get (PR#151)
With 0.63.3, try test <- function(){ fn <- function(a) print("hello") print(is.function(fn)) print(names(formals("fn")))} test() if fn is not quoted in the last line of test, it works properly. test <- function(){ fn <- function() print("hello") formals(fn) <- alist(a=,b=) return(fn)} formals(test()) now try with line 3 of test changed to
2019 Jun 05
2
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
On 6/5/19 6:15 AM, Richard W.M. Jones wrote: > Split h->state into: > > - h->state = the state on entry to the locked region > > - h->next_state = the current state and what the "publicly visible" > state will become when we leave the locked region The rest of this thread discusses potential other names, such as h->public_state for the state visible
2011 Oct 22
2
Expanding rows of a data frame into multiple rows
The setup: I have a data frame where one column is in list mode, and each entry contains a vector of varying length. I want to expand this into a data frame with one row for each member of the list-mode column (the other values being replicated) For example, an example input and the desired output would be: input <- data.frame(site = 1:6, sector =
2009 Aug 21
4
Where to put source code?
I'm trying to move from Matlab to R, and I'm stuck even getting started. This sounds to me like the dumbest question in the world but... how does one put R source code in files? Over the last three days I've gone front to back through the Introduction to R and the R Language Definition, and while I'm excited that the language is so Lispish, none of what I read described how to
2017 Jun 27
0
Seg Fault memory violation
Greetings all, Recently ran into a seg fault the keeps reoccurring whenever R-java is used (I believe). Not sure if this is an R issue or an openjdk issue so I'm trying to cover all bases with this report. I tried downgrading R version from 3.4.0 to 3.3.3 with the same results. Also tried downgrading java version from 1.8 to 1.7 with no luck. Running on a fully updated CentOS 7 x86_64,
2004 Jan 15
3
Extracting multiple elements from a list
For a long time I've wanted a way to conveniently extract multiple elements from a list, which [[ doesn't allow. Can anyone suggest an efficient function to do this? Wouldn't it be a sensible addition to R? For example, alist <- list() alist[[1]] <- list() alist[[1]]$name <- "first" alist[[1]]$vec <- 1:4 alist[[2]] <- list() alist[[2]]$name <-
2013 Jul 07
2
The *tmp* variable
When complex assignments are performed, the R interpreter creates, then removes a special variable *tmp*. However, when byte compiling is enabled, it seems that a different mechanism for making compound assignments is used. Would it be possible to eliminate *tmp* from interpreted R code as well? It might be useful for a function to lock its own environment, and the appearance and disappearance of
2012 Apr 05
2
indexing data.frame columns
Consider the data.frame: df <- data.frame(A = c(1,4,2,6,7,3,6), B= c(3,7,2,7,3,5,4), C = c(2,7,5,2,7,4,5), index = c("A","B","A","C","B","B","C")) I want to select the column specified in 'index' for every row of 'df', to get goal <- c(1, 7, 2, 2, 3, 5, 5) This sounds a lot like the indexing-by-a-matrix
2019 Jan 25
0
[klibc:update-dash] builtin: Fix handling of trailing IFS white spaces
Commit-ID: 9c83a988fbbacc54bdf700ffc94c5420beb14909 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=9c83a988fbbacc54bdf700ffc94c5420beb14909 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Sun, 12 Jun 2016 20:17:48 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] builtin: Fix handling
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix handling of trailing IFS white spaces
Commit-ID: 5d0e205c474c4df839f92663457acc991d867c25 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=5d0e205c474c4df839f92663457acc991d867c25 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Sun, 12 Jun 2016 20:17:48 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: builtin: Fix
2018 Aug 13
2
substitute() on arguments in ellipsis ("dot dot dot")?
Interestingly, as.list(substitute(...())) also works. On Sun, Aug 12, 2018 at 1:16 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > On 12/08/2018 4:00 PM, Henrik Bengtsson wrote: >> >> Hi. For any number of *known* arguments, we can do: >> >> one <- function(a) list(a = substitute(a)) >> two <- function(a, b) list(a = substitute(a), b =