Displaying 20 results from an estimated 2000 matches similar to: "avoid a loop"
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
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 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
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.
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
2010 Nov 10
3
create a pairwise coocurrence matrix
Hi all,
I am trying to construct a pairwise coocurrence matrix for certain terms
appearing in a number of documents. For example I have the following table
with binary values showing the presence or absence of a certain term in a
document:
term1 term2 term3 term4 term5 doc1 1 1 0 0 1 doc2 1 1 0 1 1 doc3 1 0 0
0 1
And I want to have a matrix with the number of the pairwise coocurrencies.
So,
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
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
2011 May 14
1
Identify Objects that end with .f (and all caps)
Dear R Helpers,
I am trying to find a way to identify all the objects in my environment
that are all caps and then end with .f. I can do the all caps part pretty
easily, but I have tried a number of variations on the \ and can't get a
recognition of that operator. As a simple example
A.f<-"foo1"
AA.f<-"foo2"
aa.f<-"foo3"
A.a<-"foo4"
ls()
2010 Mar 06
0
[LLVMdev] constness of APFloat::toString
On Mar 6, 2010, at 3:39 AM, Jochen Wilhelmy wrote:
> Hi!
>
> I wonder if llvm::APFloat::toString() can be const since
> it should not modify the APFloat.
Done in r97883, thanks.
2007 Jul 30
1
filenames
Dear all,
I want to create filename from a loop, say, i=(1:10), and the final names
will be file1.csv, file2.csv, file3.csv
in Python, it seems easer as - "file"+str(i) +'.csv , but how can i do in R
> list = as.character(1:10)
> list
[1] "1" "2" "3" "4" "5" "6" "7" "8" "9"
2020 Oct 10
2
Question about the example of link time optimization
Hi all!
I played around with the LLVM LTO
example(https://llvm.org/docs/LinkTimeOptimization.html#example-of-link-time-optimization),
but got some questions.
As the document says, the function foo4 should be removed. However,
under my test, function foo4 is not removed.
I have tried both gnu ld with LLVMgold.so and lld, neither of them
removes function foo4.
I compile and run the example as
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]]
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
2010 Dec 20
6
sample() issue
> length(sample(25000, 25000*(1-.55)))
[1] 11249
> 25000*(1-.55)
[1] 11250
> length(sample(25000, 11250))
[1] 11250
> length(sample(25000, 25000*.45))
[1] 11250
So the question is, why do I get 11249 out of the first command and not
11250? I can't figure this one out.
Thanks
Cory
[[alternative HTML version deleted]]
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)
{
2006 Jun 07
3
Building packages in R - 'private' functions
Hello.
I am creating an R package that I'd like to submit to CRAN (OS Windows
XP). How do I distinguish among 'public' functions, e.g., those that are
intended to be called by users of the package and for which I am providing
documentation & examples, and 'private' functions, which are used
internally by the 'public' functions, but for which I do not wish to
2004 Apr 20
2
Creating variable names
My apologies for asking what is doubtless a dumb question, but I have
scant experience in R.
It would be very convenient in doing lots of plots to be able to do them
in a loop that stepped through a vector of variable names. For example
one could say
x<-("mydates")
y<-c("foo1","foo2","foo3") #where "foon" were vectors