similar to: Finding all rows of a matrix equal to vector

Displaying 20 results from an estimated 700 matches similar to: "Finding all rows of a matrix equal to vector"

2013 Oct 11
3
matrix values linked to vector index
Hi, In the example you showed: m1<- matrix(0,length(vec),max(vec)) 1*!upper.tri(m1) #or ?m1[!upper.tri(m1)] <-? rep(rep(1,length(vec)),vec) #But, in a case like below, perhaps: vec1<- c(3,4,5) ?m2<- matrix(0,length(vec1),max(vec1)) ?indx <- cbind(rep(seq_along(vec1),vec1),unlist(tapply(vec1,list(vec1),FUN=seq),use.names=FALSE)) m2[indx]<- 1 ?m2 #???? [,1] [,2] [,3] [,4] [,5]
2002 Jun 28
1
Problem in optim(method="L-BFGS-B") (PR#1717)
Full_Name: Jörg Polzehl Version: 1.5.1 OS: Windows 2000 Submission from: (NULL) (193.175.148.198) When calculating MLE's in a variance component model using constrained optimization, i.e. optim(...,method="L-BFGS-B",...) I observed an inproper behaviour in cases where the likelihood function was evalueted at the constraint. Parameters and value of the function at the constraint
2012 Oct 26
3
summation sign
Hi all, I have a very quick question on how to use the summation sign in R for the function. Here?s a basic example: the function is sum(i=1 to 5)log(1-xi^2) Id be grateful if someone knows how to do this without writing it out 5 times - I am looking sth along the lines of the following: computeR <- function(x) { return (-sum(log(1-x^2)) }^ thank you vm in advance! -- View this
2006 Nov 04
2
Placing of legends
Hello, placings of legends is sometimes tricky. For placing outside the plot region I found locator to be useful. Unfortunately, the click defines the upper left corner. Is there a way to change this corner (say lower right corner)? Thanks, Christian
2009 Oct 30
2
data.frame extracting data row-wise
Dear All, I am struggling with extracting data from a data frame: x=data.frame(a=1:11,b=100:110) What I want is a list/vector in this sence: 1 100 2 101 3 102... For single rows, this works fine: as.matrix(x)[1,] For, say 2 rows, this works fine: z=c(as.matrix(x)[1,],as.matrix(x)[2,]) But z=c(as.matrix(x)[1:2,]) gives 1 2 100 101!? Is there an 'automated way' to produce a
2010 May 06
3
Intersection list
How can I create intersections of vectors? a <- c(1,2,3) b <- c(1,5,6) the intersected list c should contain c(1)... Ralf
2011 Jun 03
4
Problem using read.xls - Everything converted to factors
Hallo, I would like to use to read.xls function from the gdata package to read data from Microsoft Excel files but I experienced a problem: For example I used the following code: testfile<-read.xls("/home/.../wsjecon0603.xls", #file path header=F, dec=",", na.strings="n.a.", skip=5, sheet=2,
2009 Oct 29
1
correlated binary data and overall probability
Dear All, I try to simulate correlated binary data for a clinical research project. Unfortunately, I do not come to grips with bindata(). Consider corr<-data.frame(ID=as.factor(rep(c(1:10), each=5)), task=as.factor(rep(c(1:5),10))) [this format might be more appropriate:] corr2<-data.frame(ID=as.factor(rep(c(1:10),5)), tablet=as.factor(rep(c(1:5),each=10))) Now, I want to
2007 Feb 27
2
factor documentation issue
There is a warning in the documentation for ?factor (R version 2.3.0) as follows: " The interpretation of a factor depends on both the codes and the '"levels"' attribute. Be careful only to compare factors with the same set of levels (in the same order). In particular, 'as.numeric' applied to a factor is meaningless, and may happen by implicit coercion.
2002 Jan 05
1
root fs not mounting ext3
I am using SuSE 7.3 compiled ext3 support into the kernel and installed it. All my partitions load up as ext3 except / . I ran tune2fs several times, still doesn't take on the / drive. Most recent dumpe2fs -h show no features on that drive=, I keep going around in circles, removing .journal from / and running tune2fs but it never works for / What am I doing wrong? ( thanks in advance)
2009 Nov 07
1
lme4 and incomplete block design
Dear list members, I try to simulate an incomplete block design in which every participants receives 3 out of 4 possible treatment. The outcome in binary. Assigning a binary outcome to the BIB or PBIB dataset of the package SASmixed gives the appropriate output. With the code below, fixed treatment estimates are not given for each of the 4 possible treatments, instead a kind of summary
2007 May 05
3
Tell me why my Shoutcase handler sucks!
So, I want to build the greatest online radio ever! (for my, currently crappy, faderwave.net radio station. Right now, I''m running Icecast straight up. The only problem is that managing different DJs and keeping them off the air when they aren''t supposed to be there is a pain. There also is not one single management package that does everything. My current system is a hacked
2006 Mar 25
14
Creating a symbolic link within a Rails application?
Hi, how does one create a symbolic link within a Rails application? At this time, I can perform this action at the command line but I''m not sure how to do it within Rails. BTW, I''m doing the following command in Mac OS X: ln -s $SITE_ROOT/common_directory/* $SITE_ROOT/new_directory Thanks in advance, -Conrad -------------- next part -------------- An HTML attachment was
2002 Jan 29
5
Still no luck on command line parse
Thanks, bjornr, however your suggestion to try: wine "C:\Program Files\intuit\qbtimer\qbtimer.exe" gave the same result as the other command lines I tried. All invoke the qbtimer program and all get the same error from qbtimer: Can't find timer file "Files/intuit/qbtimer.exe" ... So wine properly finds the qbtimer.exe file. The error arises after the program is
2006 Nov 09
8
Distroy to experiment with Xen?
Hello, I would like to experiment with Xen some to see how I could integrate it in my various web application environments and hopefully make my life easier. I am currently using FreeBSD 6 but it seems that it doesn''t fully support Xen. I did some searching around and also notice some posts on mailing lists mentioning some trouble with the CentOS 4 distribution (something about the
2007 Jul 27
3
Is mechanize thread safe?
Hello all, I was just wondering if anybody knew whether mechanize is supposed to be thread-safe or not? I didn''t really find any information about it anywhere. I''ve been getting a strange error in protocol.rb when I run a script that uses mechanize in a multi threaded fashion, but not with a single thread. I''m trying to write a spider that does multiple gets in
2006 Aug 05
3
Apache 2.2 + Mod Proxy Balancer + Mongrel - Hot Linking Protection?
Hey guys, Ok, basically I coded a ruby on rails CMS to manage a bunch of media files. I am finding that a lot of people are "hot linking" to these media files and would like to prevent this to save bandwidth. Usually in the past, it hasn''t been a problem, I would add something like the following to my .htaccess file RewriteEngine on RewriteCond %{HTTP_REFERER} !^$
2006 May 29
4
Time-based cache fragment expiration
Hello, I''m trying to figure out how I could implement fragment caching that expires every x amount of time. I thought of writing a runner script that would expire the cache and set it as a cron job, but that doesn''t really work because runner scripts act on models and not controllers. Does anybody have any ideas? Regards, -carl
2010 Oct 06
1
R getting slower until it breaks...
Hello R-users, I'm currently facing a pretty hard problem which I'm hopping you'll be able to help me with. I'm using R to create images. That alone is not the problem, the problem is that I'm using R to create 168 000 images... My code (which is given below) use different package (raster and rgdal) to import a image (size 20gig) and divide it into 168 000 pictures that are
2007 Jun 13
4
network raid file system/server
hi, we've a few 10-20 server in a lan each has 4-8 hdd. we'd like to create one big file server on these server hard disks and we'd like to create it in a redundant way ie: - if one (or more) of the hdd or server fails the whole filesystem still usable and consistent. - any server in this farm can see the same storage/filesystem. it's someting a big network raid5-6... storage where