similar to: Matrix package: band matrix

Displaying 20 results from an estimated 500 matches similar to: "Matrix package: band matrix"

2009 Mar 11
3
Matrix Construction; Subdiagonal
I'm trying to enter a vector into the subdiagonal of a matrix but cannot find a command in R which corresponds to the MatLab version of diag(vec, k), where vec = the vector of interest, and k = the diagonal (k=0 for the diagonal; k=-1 for the subdiagonal; k=1 for superdiagonal, etc.) Is there an equivalent command in R? I'm looking for something like this: vec = seq(1, 5, 1)
2005 Jul 12
3
elegant matrix creation
Hi I want to write a little function that takes a vector of arbitrary length "n" and returns a matrix of size n+1 by n+1. I can't easily describe it, but the following function that works for n=3 should convey what I'm trying to do: f <- function(x){ matrix(c( 1 , 0 , 0 , 0, x[1] , 1 , 0 , 0, x[1]*x[2] , x[2] , 1 , 0,
2012 Apr 12
3
writing spdiags function for R
Dear R-list, I am in the process of translating a long function written in Matlab into R (mainly because I am a big of fan of R, and folks will not have to pay to use it :). In the translation of this function I got stack because they use spdiags, which, as far as I can tell it is not available in R. I have explored the Matrix package, from which I borrowed some of the functions (e.g.,
2015 Dec 18
2
Problem! Dovecot 2.2.9 does not send the information on ending the quota to user
Hi. I have Dovecot + Postfix + MySQL. Version of Postix: postfix_2.11.3-1ubuntu1_amd64 Version of Dovecot: 2.2.9 Operations system is: Ubuntu 15.04 x64 Postfix have patched (patch VDA - http://vda.sourceforge.net) for using with quota, it means that file "maildirsize" in mail directory already exists and changed when add/delete mail. Quota for virtual box take in MySQL db.
2008 Oct 09
4
runs of heads when flipping a coin
Can someone recommend a method to answer the following type of question: Suppose I have a coin with a probability hhh of coming up heads (and 1-hhh of coming up tails) I plan on flipping the coin nnn times (for example, nnn = 500) What is the expected probability or frequency of a run of rrr heads* during the nnn=500 coin flips? Moreover, I would probably (excuse the pun) want the answer for a
2002 Oct 31
2
Tables in graphics window
Hello, I would like to include a table (of rax data, not summary statistics - in case this makes any difference) alongside a plot. I know how to use 'layout' to divide my page into sections, but is it possible to put a table into one of these? Thanks! Tanya Murphy -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2009 Oct 15
1
calculating p-values by row for data frames
Hello R-users, I am looking for an elegant way to calculate p-values for each row of a data frame. My situation is as follows: I have a gene expression results from a microarray with 64 samples looking at 25626 genes. The results are in a data frame with the dimensions 64 by 25626 I want to create a volcano plot of difference of means vs. ?log(10) of the p-values, comparing normal samples to
2005 Jul 10
3
not supressing leading zeros when reading a table?
Dear R list, I have a dataset with a column which should be read as character, like this: name surname answer 1 xx yyy "00100" 2 rrr hhh "01" When reading this dataset with read.table, I get 1 xx yyy 100 2 rrr hhh 1 The string column consists in answers to multiple choice questions, not all having the same number of answers. I could format the
2006 Oct 20
6
summing elements in a list of functions
Dear all, I have looked for an answer for a couple of days, but can't come with any solution. I have a set of functions, say: > t0 <- function(x) {1} > t1 <- function(x) {x} > t2 <- function(x) {x^2} > t3 <- function(x) {x^3} I would like to find a way to add up the previous 4 functions and obtain a new function: > rrr <- function(x) {1+x+x^2+x^3} without,
2007 May 03
1
Issue with the Matrix package
Hi all, I am wondering if this is a bug in the Matrix package or if it something that I am just getting wrong...here is an example: > m = matrix(0,4,4) > dimnames(m) = list(letters[1:4], letters[5:8]) > r = c("a","b","a","d") > m[r,2] = 1 > m e f g h a 0 1 0 0 b 0 1 0 0 c 0 0 0 0 d 0 1 0 0 > M = Matrix(0,4,4) > dimnames(M) =
2017 Oct 31
2
Help with Nesting
How do i resolve this? symbol <- c('RRR' ,'GGG') for(i in seq_along(symbol)) { dat <- Quandl("LLL/symbol[i]") } required solutionis a loop where Quandl is a function and it loops as flows, Quandl("LLL/RRR") Quandl("LLL/GGG")
2009 Nov 02
2
a prolem with constrOptim
Hi, I apologize for the long message but the problem I encountered can't be stated in a few lines. I am having some problems with the function constrOptim. My goal is to maximize the likelihood of product of K multinomials, each with four catagories under linear constraints on the parameter values. I have found that the function does not work for many data configurations. #The likelihood
2010 Aug 29
2
OSX 10.6.4 error with -R option
Hi All, I have had reports of problems with the -R option on OSX 10.6.4. Just tested it myself and found this odd result: When I run this "dtruss -f path/to/rsync -aHAXNR --fileflags --force-change --protect-decmpfs --stats -v /Users/astrid/Documents/main.m /Users/astrid/Desktop/rrr it produces the expected results with the relative folder paths in place
2011 May 31
1
How to get the rows corresponding to the maximum of a factor
I have a data frame as follows: MsgType eotpd fn FI 2011-05-13 01:40:00 0 FF 2011-05-13 01:39:53 0 TC 2011-05-13 01:39:45 0 FI 2011-05-14 00:58:46 1 FF 2011-05-14 00:58:46 1 FI 2011-05-15 00:48:32 2 FF 2011-05-15 00:48:21 2 TC 2011-05-15 00:48:15 2 FI 2011-05-16
2002 Jan 24
5
aggregate, by tapply
Dear R users I searched some sources but i did not find an answer.Please give me some hint to following problem. I would like to compute a summary statistic for some vector for different factor levels. I know I can use tapply or aggregate but I do not know if there is a way how to use function with several (two) variable input (like weighted.mean). I wrote a simple a function for factor
2004 Mar 30
1
Windows client using UPPERCASEto connect to Samba3.02aserve
Hi again and thanks I'm using WinNT 4.0 as my network PDC. The Samba server is only a member server. Any idea how to solve this issue? Thanks, Miki > -----Original Message----- > From: Nigel Marsh [SMTP:Nigel.Marsh@first-linux.com] > Sent: Mon, March 29, 2004 11:59 AM > To: samba@lists.samba.org > Subject: Re: [Samba] Windows client using UPPERCASEto connect to >
2007 May 31
2
A matrix with mixed character and numerical columns
Is it possible to have one? I have a data.frame with two character columns and 6 numerical columns. I converted to a matrix as I needed to use the col() and row() functions. However, if I convert the data.frame to a matrix, using as.matrix, the numerical columns get converted to characters, and that messes up some of the calculations. Do I really have to split it up into two matrices, one
2013 Mar 27
1
Pattern matching repeating digits
'lo, all, Is there some (possibly undocumented?) way that I can pattern-match on a specified number of repeating digits? (Something similar to regular expressions' {}) Here's an example: let's say I have a string of things that need to be done for both extensions 233 and 255. I can either... A) Repeat the exact same code for both extensions, like so: exten =>
2012 Oct 09
4
Convert COLON separated format
I have a bunch of data sets that were created for the libsvm tool. They are in "colon separated sparse format". i.e. 1 5:1 27:3 345:10 Is a row with the label of "1" and only has values in columns 5, 27, and 345. I want to read these into a data.frame in R. Is there a simple way to do this? -- Noah Silverman, M.S. UCLA Department of Statistics 8117 Math Sciences
2011 Feb 25
1
Accessing sub diagonals / spdiag in R ?
Hello, I'm attempting to access a specific number of sub diagonals in a MATRIX and have been accustomed to using spdiags in MATLAB or Octave. I've got a solution pieced together using for loops and it works though isn't vectorized and liable to run very slow for large matrices. As an example: A = 1 2 3 4 5 9 8 7 6 5 4 5 6 7 8 5 4 3 2 1 8 7 6 0 1 The subdiagonals are: 9,5,3,0 4,4,6