similar to: No subject

Displaying 20 results from an estimated 9000 matches similar to: "No subject"

2003 May 24
2
Interpretation of escaped characters in \examples{}
I've noticed a curious interpretation of escaped characters in \examples{} in .Rd files. For example, if I type files <- dir(pattern="\\.txt") at the R prompt, I will get a vector containing all file names in the current directory containing the string ".txt". If I put \examples{ files <- dir(pattern="\\.txt") } in an .Rd file of a package,
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2006 Mar 25
7
Regexp subexpression
I can't get the PERL subexpression translated to R. Following, for example, B. Ripley's http://finzi.psych.upenn.edu/R/Rhelp02a/archive/58984.html I am using sub, but it looks like an ugly substitute. Assume I want to extract the first alpha part and the first numeric part, but only if they are in sequence. Do I really have to use the sub twice, first extracting the first variable, then
2012 Nov 09
4
as.data.frame(do.call(rbind,lapply)) produces something weird
The following code: --8<---------------cut here---------------start------------->8--- > myfun <- function (x) list(x=x,y=x*x) > z <- as.data.frame(do.call(rbind,lapply(1:3,function(x) c(a=paste("a",x,sep=""),as.list(unlist(list(b=myfun(x),c=myfun(x*x*x)))))))) > z a b.x b.y c.x c.y 1 a1 1 1 1 1 2 a2 2 4 8 64 3 a3 3 9 27 729
2012 Feb 07
2
Canonical package directory name for JAR files?
We have an R package which needs to include a JAR file. Is there a canonical directory for it?
1997 Oct 17
1
R-beta: more model.matrix
I am trying to show some techniques to my graduate regression class. The textbook mentioned using bootstrap samples of regression coefficients for assessing variability. I decided to show them reasonably effective ways of doing the resampling. The following is a function I wrote to create bootstrap samples of coefficients from a fitted linear regression model. bsCoefSample <- ##
2010 Sep 03
3
S4 Method Signatures
Hello, If the signature of a method defines which generic it implements then I'm confused about why this minimal example I invented won't work : setGeneric("myFun", function(rs, ...){standardGeneric("myFun")}) setGeneric("myFun", function(cs, ...){standardGeneric("myFun")}) setMethod("myFun", "numeric", function(rs, colour =
2003 Apr 17
4
A function as argument of another function
Dear all, I would like to write a function like: myfun<-function(x,fn) {xx<-exp(x); x*fn(xx)} where fn is a symbolic description of any function with its argument to be specified. Therefore myfun(5,"2+0.3*y^2") should return 5*(2+0.3*exp(5)^2), myfun(5,"log(y)") should return 5*log(exp(5)) and so on. I tried with "expression" and others, but without success.
2011 Sep 26
4
Testing for arguments in a function
I don't understand how this function can subset by i when i is missing.... ## My function: myfun = function(vec, i){ ret = vec[i] ret } ## My data: i = 10 vec = 1:100 ## Expected input and behavior: myfun(vec, i) ## Missing an argument, but error is not caught! ## How is subsetting even possible here??? myfun(vec) Is there a way to check for missing function arguments, *and*
2006 Feb 02
2
How to get the namespace of a function?
I declared the environment of the function myfun to be NULL as follows: environment(myfun) <- NULL Later on I called that myfun and got an error message because the function index() in the zoo package was called inside myfun and was not visible: Error in myfun(args) : couldn't find function "index" I tried to use zoo::index() instead of index(), but that did not work. In fact,
2017 Jun 27
4
[PATCH v4] nv110/exa: update sched codes
v4: Updated the wait dependancy bars based on tex component masks. This patch adds proper delays to maxwell exa shaders. Tested with rendercheck -f a8r8g8b8. I am still wondering whether the rd's are required. We could still wait on the write bars instead. eg. see "sched (st 0xf wr 0x1 wt 0x2) (st 0xf wr 0x1 wt 0x2) (st 0xf)" in exacmnv110.fp Trello:
2013 Jun 07
1
It seams that fast99 function (sensitivity package) does not work out for norm distribution.
Dear all mailing listers, Does Anyone have the same problem as mine when using the fast99 (extended-FAST method) to perform SA of model with norm distribution inputs? See the simple example given following. Any suggestion will be greatly appreciated. Thank you! Marino # Simple example # 1. uniform version (It works well) library(sensitivity) Myfun<-function(x){return(rowSums(x))} SA1
2023 Aug 03
3
feature request: optim() iteration of functions that return multiple values
Dear all, I have used optim a lot in contexts where it would useful to be able to iterate function myfun that, in addition to the primary objective to be minimized ('minimize.me'), could return other values such as alternative metrics of the minimization, informative intermediate values from the calculations, etc. myfun <- function() { ... return(list(minimize.me = minimize.me, R2 =
2015 Oct 22
2
Changed behaviour when passing a function?
Of course (and unsurprisingly) Duncan is correct. I see that behavior in R 3.1.0, as well as the modern ones Duncan mentioned. What I said is true, as far as it goes, but the symbol being resolved is FUN, so when looking for a function it doesn't find the function version of round. Did you perhaps have a function named FUN in your global environment? If so you are being bitten by what I
2017 Jun 10
2
[PATCH v3] nv110/exa: update sched codes
This patch adds proper delays to maxwell exa shaders. rendercheck tests seem consistent with/without this patch. I haven't extensively tested them though. Trello: https://trello.com/c/6LPB2EIS/174-update-maxwell-shaders-with-proper-delays Signed-off-by: Aaryaman Vasishta <jem456.vasishta at gmail.com> --- src/shader/exac8nv110.fp | 10 +++++----- src/shader/exac8nv110.fpc | 18
2017 Jul 01
2
[PATCH 1/2] nv110/exa: Remove depbars
Removed explicit depar instructions as they're not used by the blob anymore. Signed-off-by: Aaryaman Vasishta <jem456.vasishta at gmail.com> --- src/shader/exac8nv110.fp | 5 ++--- src/shader/exac8nv110.fpc | 10 ++++------ src/shader/exacanv110.fp | 5 ++--- src/shader/exacanv110.fpc | 10 ++++------ src/shader/exacmnv110.fp | 5 ++--- src/shader/exacmnv110.fpc | 10 ++++------
2017 Jun 03
2
[PATCH v2] nv110/exa: update sched codes
v2: Add missing delays This patch adds proper delays to maxwell exa shaders. rendercheck tests seem consistent with/without this patch. I haven't extensively tested them though. Trello: https://trello.com/c/6LPB2EIS/174-update-maxwell-shaders-with-proper-delays Signed-off-by: Aaryaman Vasishta <jem456.vasishta at gmail.com> --- src/shader/exac8nv110.fp | 10 +++++-----
2011 Feb 02
1
pass nrow(x) to dots in function(x){plot(x,...)}
Dear Rers, I have a function to barplot() a matrix, eg myfun <- function(x, ...) { barplot(x , ... )} (The real function is more complicated, it does things to the matrix first.) So I can do: m1 <- matrix(1:20,4) myfun(m1) myfun(m1, main="My title") I'd like to be able to add the number of rows of the matrix passed to the function to the "..." argument, eg
2009 Jun 26
3
changing default arguments of a function and return the modified function as a result
Dear R-users, I am trying to develop a function that takes another function as an argument, changes its default values and returns a list of things, among which the initial function with its default arguments changed. An example of what i will like to obtain below: ## initial function myfun <- function(x, a=19, b=21){ return(a * x + b) } ## this is the function i will like to create ##