Displaying 20 results from an estimated 8000 matches similar to: "assign names to vectors in loop"
2007 Oct 10
1
Deleting for() loop in function
Dear UseRs,
I wrote following function in order to solve Data Envelopment Analysis.
Reason for posting is that the function is slow when nrow(dat) is large.
I wonder if other functions could substitute the for() loop in the
code, such as mapply().
Can anybody help to rewrite the dea() function as efficiently as
possible?
The code is as follows:
2012 Mar 18
3
assign a value to an element
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20120318/d68edf35/attachment.pl>
2006 Aug 22
2
listing a sequence of vectors in a matrix
Hi,
I'm having trouble applying the matrix function. I'd like to be able to
create a matrix of vectors filled in by rows, which are not all the same
length, and so I need it to fill in NAs where applicable.
It's easiest to explain with a simple example:
Suppose vec = c(3,4,5). How can I form a matrix of the vectors 1:vec[j]
for j=1:3?
i.e. 1 2 3 NA NA
1 2 3 4
2009 Jan 13
5
acroread = resource hog
Any have trouble with acroread taking up massive cpu and memory?
I exited my Firefox browser and the lil bastard was still hogging up
my resources.
Took up 69% of 4GB, and wouldn't let go, until a kill -9 showed'em,
have to do it every time I open a pdf in firefox.
Any use Xpdf or something else?
2004 Aug 06
2
ices - cpu cycles - re encodig
At 11:17 AM 29/10/2002 -0700, you wrote:
>I'm doing a top on my server (ices2 and icecast2 from CVS) and ices is
>using 14% of my cpu cycles - bastard! One channel is doing reencoing
>and when I just play an ogg without reencoding. The ogg file was
>encoded at 64kbs 44khz
Is this praise, a bug report, a question, or other? If you're having
a problem with the software, it
2009 Sep 01
2
cbind objects using character vectors
Dear list,
I have a character vector such vec.names<- c("a", "b")
It happens that I have also two R objects called "a" and "b" that I would
like to merge. Is it possible to
do something like cbind(vec.names[1], vec.names[2]) ending up with the same
result as cbind(a,b)
Bellow is a reproducible example of what I need to to:
dat<-
2004 Apr 29
2
IAX voicemail notification
Hey list (again - annoying bastard I am)
I've played with Firefly/* for a while and I have yet to find a way to
have * send voicemail notification to Firefly. It appears possible using
SIP (no clue whether Firefly supports it) in the sip.conf file, but
there's no mention of anything voicemail-related in the IAX.conf file.
I'm using IAX with Firefly, so that might just be the
2010 Jan 29
2
Explanation w.r.t. rbind, please!
This is what I tried:
> num.vec <- c(12.34,56.78,90.12,34.56)
> names(num.vec)<-c("first","second","third","fourth")
> num.vec
first second third fourth
12.34 56.78 90.12 34.56
> seq<-(1:4)
> num.mat<-rbind(num.vec,seq)
> num.mat
first second third fourth
num.vec
2009 Dec 11
4
extracting vectors from lists of lists
Good evening
I often have as output from simulations a list of various values, vectors
and matrices.
Supposing that I then run said simulation several times, I often want to
extract a particular result from each simulation for plotting and,
ideally, put it in a matrix.
A simple example
v1 <- 1:5
v2 <- 6:10
other1 <- "stuff"
other2 <- "stuff"
set1 <-
2011 Oct 29
4
R help with different combinations of vectors of different sizes
Hi,
I am trying to get different combinations of a vector of different size and
find their sum. For example, if I have a vector (i,j) where i and j can be
anything from 0 to 5, i get these combinations (0,0), (0,1), (1,0), (1,1),
(2,0), ...... (5,5) and find sum of these as 0, 1, 1, 2, ..... , 10. I used
outer functions to get this and it worked. What if I have a vector (i,j,k)
where all i, j ,
2006 Apr 04
1
Indexing a vector by a list of vectors
Hello R-help -
I have
vec <- c("string1", "string2", "string3")
ind <- list(c(1,2),c(1,2,3))
I want "vec" indexed by each vector in the list "ind".
The first element of the list I want would be vec[c(1,2)],
the second element would be vec[c(1,2,3)], like the following.
[[1]]
[1] "string1" "string2"
[[2]]
[1]
2010 Dec 22
3
How to integrate a function with additional argument being a vector or matrix?
Dear expeRts,
I somehow don't see why the following does not work:
integrand <- function(x, vec, mat, val) 1 # dummy return value
A <- matrix(runif(16), ncol = 4)
u <- c(0.4, 0.1, 0.2, 0.3)
integrand(0.3, u, A, 4)
integrate(integrand, lower = 0, upper = 1, vec = u, mat = A, val = 4)
I would like to integrate a function ("integrand") which gets an "x" value (the
2013 Apr 17
2
On matrix calculation
Hello again,
Let say I have a matrix:
Mat <- matrix(1:12, 4, 3)
And a vector:
Vec <- 5:8
Now I want to do following:
Each element of row-i in 'Mat' will be divided by i-th element of Vec
Is there any direct way to doing that?
Thanks for your help
2013 Mar 08
2
Unexpected behaviour of apply()
Hello everyone,
Considering the following code sample :
----
indexes <- function(vec) {
vec <- which(vec==TRUE)
return(vec)
}
mat <- matrix(FALSE, nrow=10, ncol=10)
mat[1,3] <- mat[3,1] <- TRUE
----
Issuing apply(mat, 1, indexes) returns a 10-cell list, as expected.
Now if I do:
----
mat[1,3] <- mat[3,1] <- FALSE
apply(mat, 1, indexes)
----
I would expect a
2010 Aug 17
4
replacing values in a vector
Dear helpRs
Does anyone have an elegant way of doing the following:
For a given numeric vector, e.g. vec <- c(3,2,6,4,7)
Create a series of vectors where all but 1 of the values are replaced by
0's, e.g.
vec.a <- c(3,0,0,0,0)
vec.b <- c(0,2,0,0,0)
vec.c <- c(0,0,6,0,0)
vec.d <- c(0,0,0,4,0)
vec.e <- c(0,0,0,0,7)
I have looked at `replace', but can't think of a
2005 Oct 12
0
[LLVMdev] Next LLVM release thoughts?
Hello Chris,
Chris Lattner wrote on 11/10/2005 at 6:44 p.m.:
> It has been entirely too long since the last release, and we have
> plenty of goodies for a very solid release. Do people find releases
> useful, or should we just continue to run out of CVS? Does anyone
> have any thoughts?
Yeah, I think so :) Also, it would be really nice if an official
cygwin build (the binary) was
2005 Feb 02
1
SIP with Delay
I use codec g711u or g711a but comuncation between two sip client
(XTen lite) have bastard dalay of 0,5 - 1 second
Is it normal ?
Are there any configuration to solve problem ?
Thanks all
2004 Dec 10
1
kernel update with yum - no grub entry
Hi people
I am new to this list - actually I am one of (probably) a few who are
jumping ship from WBEL. I feel like a bit of a scab jumping over at this
time - but we all make mistakes eh?
I have installed CentOS and ran 'yum update' and installed everything it
prompted me for. After a reboot, I realised I had booted into the same
original kernel-2.4.21-20.EL.c0smp and not the updated
2007 May 18
2
Split a vector(list) into 3 list
Hi,
I have a vector contains values 1,2,3.
Can I call a function split to split it into 3 vectors with 1 corresponds
to value ==1, which contain all the indexes for value==1.
2 corresponds to value ==2 which contain all the indexes for value=2
Thanks
pat
2004 Sep 10
1
Can I STOP decoding at an exact sample?
Hi guys,
Thanks Matt for your prompt response about the C++ problem, its working
great now!
Again for my "virtual cdplayer", I am wondering if its possible to stop
decoding within a large file, at the end of an exact sample?
ie. I wish to play a song in the middle of a flac'd cd. Using the file
decoder, I can seek to the start of the track(index 01 of the cds TOC),
but I then want