similar to: Creating variable names

Displaying 20 results from an estimated 2000 matches similar to: "Creating variable names"

2006 Apr 11
2
About list to list - thanks
Thank you very much for your useful suggestions. These are exactly what I was looking for. foo <- list(foo1, foo2, foo3) lapply(foo, function(x) matrix(unlist(x), nrow = length(x), byrow = TRUE)) or lapply(foo, function(x) do.call('rbind', x)) Best, Muhammad Subianto On 4/11/06, Muhammad Subianto <msubianto at gmail.com> wrote: > Dear all, > I have a result my experiment
2006 Apr 11
2
About list to list
Dear all, I have a result my experiment like this below (here my toy example): foo1 <- list() foo1[[1]] <- c(10, 20, 30) foo1[[2]] <- c(11, 21, 31) foo2 <- list() foo2[[1]] <- c(100, 200, 300) foo2[[2]] <- c(110, 210, 310) foo3 <- list() foo3[[1]] <- c(1000, 2000, 3000) foo3[[2]] <- c(1100, 2100, 3100) list(foo1,foo2,foo3) The result: > list(foo1,foo2,foo3) [[1]]
2008 Mar 25
1
Passing (Optional) Arguments
Dear List: In short, I am writing a number of functions as building blocks for other functions and have some questions about scoping and passing arguments. Suppose I have functions foo1, foo2, and foo3 such that: foo1<-function(a=1,b=TRUE,c=FALSE){#do stuff}; foo2<-function(x=1,y=FALSE,z=c(1,2,3,4)){#do stuff}; foo3<-function(lambda,...){lambda*foo1()*foo2()}; I want to be able to
2006 Jun 29
3
advice on arguments
I have a general style question about R coding. Suppose I'm writing a function (foo1) that calls other functions (foo2, foo3, ...) which have complicated argument lists (e.g. optim(), plot()), _and_ I may be calling several different functions in the body of foo1. Since foo2 and foo3 have different sets of arguments, I can't just use "..." ; I did write some code a while ago
2010 Feb 10
1
How to solve: Error in * unused argument(s) ?
Hi all, For some reason, I would like to use functions bellow (see example code bellow), but instead I get the following error message: *Error in foo2(...) : unused argument(s) (arg3 = 3)* #--------------------- # example code #--------------------- foo1 <- function(arg1,...) { print(arg1) foo2(...) foo3(...) } foo2 <- function(arg2) { print(arg2) } foo3 <- function(arg3) {
2012 Nov 06
1
Depends/Imports/Suggest/Enhence
Hi the list In the DESCRIPTION file of my package foo0, I have: Depends: foo1 Imports: foo2 Suggest: foo3 Enhence: foo4 If I understand correctly, to install foo0 on my computer, I need to already have foo1, foo2, foo3. foo4 is not necessary. I my R sesssion, when I will write: library(foo0), then the package foo1 will be attach. foo2, foo3 and foo4 will not. Is that correct? But what is
2014 May 02
1
Authors@R: and Author field
Hi to all Authors@R: c(person("fooa","foob", role = c("aut","cre"), email = "fooa.foob@fooc.de"), person("foo1","foo2", role = c("ctb"), email = "foo1.foo2@foo3.de")) Author: fooa foob, with contributions from foo1 foo2 using r CMD check --as-cran .. (R 3.1
2007 Dec 13
2
use ggplot in a function to which a column name is given
Hi everyone, Hi ggplot users in particular, ggplot makes it very easy to plot things given their names when you use it interactively (and therefore can provide the names of the columns). qplot(x,foo,data=A) where A has columns (x,y,foo,bar) for example but I would like to use this from inside a function to which the name of the column is given. I cannot find an elegant way to make this
2010 Mar 23
1
S4: Multiple inheritance
Hi all, Working with S4 object, I definine two class foo1 and foo2. I define '[' (resp. '[<-') for the two classes. Then I define a third class foo3 that inherit from both foo1 and foo2. Is there a way to make '[' (resp. '[<-') for foo3 inherit from '[' (resp. '[<-') for foo1 and foo2? Thanks Christophe
2010 Sep 21
2
Trouble with Optimization in "Alabama" Package
Hello, This is my first post to the help request list, so I'm going to err on the side of giving too much information. I'm working on writing a simulation in which agents will make repeated production and exchange decisions with randomly chosen partners. The idea is, all agents can produce two goods which they want to consume, they choose a value t in [0,10] which sets their production
2010 Nov 15
2
How to move an internal function to external keeping same environment?
Hi I have within a quite big function foo1, an internal function foo2. Now, in order to have a cleaner code, I wish to have the internal foo2 as "external". This foo2 was using arguments within the foo1 environment that were not declared as inputs of foo2, which works as long as foo2 is within foo1, but not anymore if foo2 is external, as is the case now. Now, I could add all those
2009 Jun 18
3
How to parse and eval a collection of items
Let's say I have, for some reason, a bunch of scalars (i.e. single-valued variables) and I want to merge them all into a single vector of values. Can someone recommend a better function, or simpler way, to do so than the following? Suppose my scalars' names are foo1, foo2, foo3, foo1high, foo2high, foo3lo2, etc. Then I can do: >ls(pat='foo')->thels
2012 Nov 07
2
Correct use of Depends, Imports and ::
Dear R developers, Taking advantage of the yesterday discussion about the use of Depends/Import/Suggests/Enhances, I would like to add a related question. Let's assume, in the DESCRIPTION file of my package foo0, I have: Depends: foo1 Imports: foo2 while in the NAMESPACE file of my package I have importFrom("foo2", f2) and within my package I use the following two external
2011 Jun 20
1
access objects by name
Hi, I have several data structures (xts structures). I then have a list of the names of those objects. I'd like to access the object by name. For example: foo1 <- as.xts(....) foo2 <- as.xts(...) foo3 <- as.xts(...) structs <- c("foo1", "foo2", "foo3") for (thisOne in structs){ print(thisOne$colA) } The above fails. Clearly I'm missing a
2010 Mar 06
3
[LLVMdev] constness of APFloat::toString
Hi! I wonder if llvm::APFloat::toString() can be const since it should not modify the APFloat. -Jochen
2002 Aug 20
6
load balancing CIFS/Samba
Hi Folks, I'm trying out some ideas for loadbalancing Samba servers with some replication underneath. Right now, we're trying to use DNS round robin, just to see if it works, but it isn't. Our basic config is that we have the same share and NMB server name on every node. Each node has a different IP hostname, which are all round-robin'ed to a single hostname. When we try to
2016 May 17
2
How to debug if LTO generate wrong code?
> On May 17, 2016, at 1:33 AM, Shi, Steven via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hello, > Let me ask a LTO simple question again. For the llvm LTO example in the link:http://llvm.org/docs/LinkTimeOptimization.html <http://llvm.org/docs/LinkTimeOptimization.html>, I use below build commands to generate three different optimization level binary: -O0, -O1, -O2.
2010 Nov 04
3
avoid a loop
Let's suppose I have userids and associated attributes... columns a and b a <- c(1,1,1,2,2,3,3,3,3) b <- c("a","b","c","a","d","a", "b", "e", "f") so a unique list of a would be id <- unique(a) I want a matrix like this... [,1] [,2] [,3] [1,] 3 1 2 [2,] 1 2 1 [3,]
2016 May 16
2
How to debug if LTO generate wrong code?
Hi Umesh, Thank you for the suggestion. I can use the "Brute force method " to narrow down the LTO wrong instructions here and there, but I still don't know why these wrong instructions are generated, and how to let Clang LTO don't generate those wrong instructions. I suspect the wrong code is caused by some LTO wrong optimization pass, so I hope to disable all optimizations in
2016 Jun 08
2
Intended behavior of CGSCC pass manager.
On Wed, Jun 8, 2016 at 9:39 AM, Daniel Berlin <dberlin at dberlin.org> wrote: > > > On Wed, Jun 8, 2016 at 4:19 AM, Sean Silva <chisophugis at gmail.com> wrote: > >> Hi Chandler, Philip, Mehdi, (and llvm-dev,) >> >> (this is partially a summary of some discussions that happened at the >> last LLVM bay area social, and partially a discussion about