similar to: R-beta: nlm

Displaying 20 results from an estimated 300 matches similar to: "R-beta: nlm"

2012 Oct 07
3
get: problem with environments
Dear R users, I am running R-2.15.1 in Linux Slackware64-14.0. Here is my minimal working example: testfun <- function (x) { a <- 0; sapply(X="a", FUN=get, envir=sys.frame(which=x)); } Inside R, that is R called from within a Linux terminal, the following code works: testfun(x=5) print(testfun(x=6)) But within rkward the above code fails and the following works: testfun(x=1)
2012 Dec 04
1
inconsistencies between ?class and ?UseMethod
Hi, The 2 man pages give inconsistent description of class(): Found in ?class: If the object does not have a class attribute, it has an implicit class, ?"matrix"?, ?"array"? or the result of ?mode(x)? (except that integer vectors have implicit class ?"integer"?). Found in ?UseMethod: Matrices and arrays have class ?"matrix"?
2020 Feb 26
3
unlink() on "~" removes the home directory
!!! DON'T TRY THE CODE IN THIS EMAIL AT HOME !!! Well, unlink() does what it is supposed to do, so you could argue that there is nothing wrong with it. Also, nobody would call unlink() on "~", right? The situation is not so simple, however. E.g. if you happen to have a directory called "~", and you iterate over all files and directories to selectively remove some of them,
2006 Dec 20
4
R windows crash (PR#9426)
Full_Name: Robert Denham Version: R-2.4.1 OS: Windows Xp Submission from: (NULL) (61.88.57.1) R gui exits without warning when I run a function which has an argument with a default that is not found. This was a result of an error in a function I wrote, but I thought that it should exit more gracefully than it does. Here is an example: testfun <- function(aa=aa) { aa <-
2009 Jun 20
2
Special characters in Rd example section will cause errors
Hi (Duncan?), The other day I noticed some characters will cause errors in R CMD CHECK because of parse_Rd(), and AFAIK, these chars include '%', '{' and '}'. For example, note the comments in the example section: %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% \name{testfun} \Rdversion{1.1} \alias{testfun} \title{ A Test } \description{ A test } \usage{ testfun() } \value{ NULL }
2011 Jul 12
2
foreach not recognizing functions in memory
All, I am not understanding the scoping used in foreach when it is used inside a function. I keep getting "could not find function" errors for functions that are in memory when I try to use foreach within a function call. I have a simple example below. "testFun" is in memory and works when called by foreach directly, but when I place foreach in a function called
2017 Jun 02
10
[RFC][ThinLTO] llvm-dis ThinLTO summary dump format
Hey all, Below is the proposed format for the dump of the ThinLTO module summary in the llvm-dis utility: > ../build/bin/llvm-dis t.o && cat t.o.ll ; ModuleID = '2.o' source_filename = "2.ll" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @X = constant i32 42, section "foo", align
2015 Feb 18
2
Different serialization of functions in interactive vs. batch mode
Hi, I posted this question to the regular help list, but it seems to be this is probably a question that is better addressed on r-devel. Sorry for the double posting. I am using hash-values to cache certain results in R. This caching also depends on the hash-value of the function that is being cached (calculated using the digest package). I noticed that computations that should already be cached
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
Dear All, I have three classes of questions about generating random numbers with different packages (windows xp 32bit R). . 1. Suppose I would like to use package *foreach*, can I use current Sys.time as a seed? Although I can get the time up to1e-6 second precesion, the code below dose not work well on a local machine with two cores. ################# library(foreach) library(snow)
2015 Feb 18
4
Different serialization of functions in interactive vs. batch mode
Hi Luke, Ah - I see - thank you! This at least points me to a way on how to "fix" this. I tried setting the srcref attribute to NULL, but the hash value is still different and so is the serialization. So this looks like it is one difference, but not all of them Even if all differences were identified - it still leaves me with different behavior between interactive and batch-mode,
2013 Jan 14
2
The three-dot question
Dear all, Why does not the three-dot accept arguments from the parent environment? I am just confused with this error, can someone give me a hint? > rm(list=ls()) > testFun <- function(a, ...) + { + if(a){ + print(a) + }else + { + print(b) + } + } > > myTask <- function(a) + { + b <- 3 + testFun(a, b = b) + } >
2005 Aug 17
4
accesing slots of S4 class in C code
I am trying to use a custom S4 object in my C code and I cannot get the access to its slots working. The following is a toy example, but even this crashes. In R I have: setClass("pd", representation(data="numeric")) x <- new("pd", data=1:5) test <- function(pd.obj) { res <- .C("TestFun", pd.obj) res} test(x) (Of couse
2017 Mar 31
2
How to write the same things as `opt` command in C++ API
Hi, I'm Ryo Ota. I'm using LLVM 3.8.1. I have a quesion about inlining function in C++ API. I'd like to inline some functions in a module in the same way as `opt -inline` command. But my C++ code didn't work what I want to do. For example, by using `opt -inline` command,`main.ll` is converted into the `inlined.ll`(`opt` command worked what I want to do) [main.ll (Not inlined)]
2012 Jun 10
3
Data.frames can not hold objects...What can be done in the following scenario?
R-Help community, I understand that data.frames can hold elements of type double, string etc but NOT objects (such as a matrix etc). This is not convenient for me in the following situation. I have a function that takes 2 inputs and returns a vector: testfun <- function (x,y) seq(x,y,1) I have a data.frame defined as follows: testframe<-data.frame(xvalues=c(2,3),yvalues=c(4,5)) I would
2009 Sep 16
3
apply function across two variables by mult factors
Greetings, I am attempting to run a function, which produces a vector and requires two input variables, across two nested factor levels. I can do this using by(X, list(factor1, factor2), function), however I haven't found a simple way to extract the list output into an organized vector form. I can do this using nested loops but it isn't exactly an optimal approach. Thank you
2012 Jun 09
1
Applying a function to a column of a data frame
Apologees the novice question. Currently climbing up the learning curve of R. Suppose I have the following function and the data.frame: testfun<-function(x=1,y=2) x+y testframe=data.frame(col1=c(1,2),col2=c(3,4)) When evaluating testfun, I want to use the default value for y (which is 2) and for x, I want to feed (one by one) the values in col2 of testframe. How can I achieve this please?
2009 Sep 24
1
how to make a function recognize the name of an object/vector given as argument
Dear guRus, I'd like to learn how to make a function recognize the name of an object/vector given as argument If I have : testFun <- function(x,y) plot(x,y, main=paste("plot of",names(x),"and",names(y)) ) # this just a simple example ... a1 <- 5:8 b1 <- 9:6 testFun(a1,b1) # Returns the plot, but not the names of the objects/vectors given as arguments, # but
2015 Feb 18
1
Different serialization of functions in interactive vs. batch mode
Hi Gabriel, thanks for your reply - it does solve the problem of my toy function, but does come with some other problems though. a) as.list(f)[[1]] yields an expression, not a function. In order to go the route you are suggesting, I would more likely use "deparse" in order to get the original back b) and more seriously - as.list strips the environment of the function (and thus
2017 Jun 02
2
[RFC][ThinLTO] llvm-dis ThinLTO summary dump format
On Fri, Jun 2, 2017 at 12:18 PM, Peter Collingbourne via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Why do we need a custom dumping format for the summary? Since we already > need the YAML format anyway, wouldn't it be better to extend that to cover > the entire summary? > IMO it is useful/convenient to be able to see the summary in the llvm-dis output. Teresa >
2017 Jun 02
2
[RFC][ThinLTO] llvm-dis ThinLTO summary dump format
On Fri, Jun 2, 2017 at 12:39 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > On Fri, Jun 2, 2017 at 12:29 PM, Teresa Johnson <tejohnson at google.com> > wrote: > >> On Fri, Jun 2, 2017 at 12:18 PM, Peter Collingbourne via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >>> Why do we need a custom dumping format for the summary? Since