similar to: Matrix manipulation

Displaying 20 results from an estimated 10000 matches similar to: "Matrix manipulation"

2007 Dec 05
2
converting factors to dummy variables
Hi all - I'm trying to find a way to create dummy variables from factors in a regression. I have been using biglm along the lines of ff <- log(Price) ~ factor(Colour):factor(Store) + factor(DummyVar):factor(Colour):factor(Store) lm1 <- biglm(ff, data=my.dataset) but because there are lots of colours (>100) and lots of stores (>250), I run it to memory problems. Now, not every
2006 Nov 16
2
.rdata files
Help! I accidentally saved my work as an .rdata format instead of .txt I need to somehow get it saved as a .txt file otherwise i'm really in trouble! Does anyone know how to convert .rdata to .txt files?? I also tried re-loading the file into R to see if i can re-save it but it doesnt work! i've attached it below... please help me asap! i need to turn it in as a .txt file Thanks
2008 Aug 08
1
Vista problem -- can't type commands at prompt
Hi All - I recently moved to Vista and reinstalled R. I am able to run R as I typically do (R.exe from the command prompt), and it can work well. However, if I switch windows to, say, firefox or excel or anything else, when I return to the R prompt it no longer works. I am able to use the up and down arrow keys to access previous commands, but no other key stroke has any impact. As long as I
2007 Dec 27
2
Help with lm and multiple linear regression? (Plain Text version)
(Apologies the previous version was sent as rich text) Hello, I'm new to R, but I've read the intro to R and successfully connected it to an instance of mysql. I'm trying to perform multiple linear regression, but I'm having trouble using the lm function. To start, I have read in a simply y matrix of values(dependent variable) and x matrix of independent variables. It says both
2006 Nov 01
1
Position of a specific letter in a character string
Dear useR, x is a character string In R: > x<- '32159_3' Which function could enable me to determine the position of underscore in x? In here, the underscore is on the 6th digit of x. --- Yours Sincerely Leon [[alternative HTML version deleted]]
2007 Oct 26
1
Accessing scripts in a different directory on a Mac
Hi all. A question for knowledgeable folks using R on an Intel Mac running OS X 10.4.10 For ease of maintenance, I have broken a large R script into a main script which ?oversees? things by calling other scripts, using ?source?. Let?s call the secondary scripts ?sub-scripts.? I?d like for the sub-scripts to reside in a different directory (again, for ease of maintenance, and so I can access
2006 Nov 17
2
Large data Problem
Hi R-Experts, I'm having a problem with reading a large data file which is in .csv format and size is 120 MB (app.). I was trying to use RODBC package but I found RODBCconnectExcel function only. And can I convert this file to .dbf format? How can I read this file? And also let me know if this was a file in .sas7bdat format, what should I do? Thanks in advance.
2007 Oct 23
2
A very simple question
Hi all, My apologies for a very simple question. I just downloaded R 2.6.0. I want to bring in all of the objects from 2.5.0 that I see when I type ls(). I have no idea how to do that. Thanks in advance. David -- ======================================================================= David Kaplan, Ph.D. Professor Department of Educational Psychology University of Wisconsin - Madison
2007 Oct 29
1
lm design matrix bug?
Hi All Maybe I dont understand it, but I would have expected that the design matrix has as many rows as there were observations available to fit the model. Below a small artificial dataset created, then one model fitted and the design matrix outputted, having 27 rows. Then I delete 6 obs, and fit the model on these 21 obs, but the design matrix that comes out has 26 rows? Thanks for your
2006 Nov 08
2
chisq test with for loop
Hi all. i am desperating. i need a matrix of p.values from an chi square test. i had it already work but than my computer collapsed when taking the whole data set 800x260 into account. i am sure it looked like this but it doesn't work now. can anybody help me? thanks in advance. x=read.table("C:\...) d=ncols(x) z<=matrix(0,d,d) for(i in 1:d) for(j in 1:d)
2007 Oct 01
1
tricky problem with "if" function -
Hi all, This question involves using a "for" loop to make a "decision" in a script. I've written a rather intricate script, and near the start of it, I want it either to do a loop (if a variable called "number.runs" > 1) or not do a loop (if "number.runs" is 1). This is probably trivial but I can't figure it out. Here's a self-contained
2007 Jan 15
4
How to format R code in LaTex documents
Hi, I am planning on putting some R script in an appendix of a LaTex document. Can anyone recommend me a way of how to format it? Is there a way to keep all line breaks without having to insert \\ in every single line? Thank you! Benjamin
2004 Aug 06
2
multiple ices streams and misc other stuff?
Brendan Cully <brendan@kublai.com> writes: > Well, it didn't work until yesterday, when I checked in a new > version. As a matter of fact it only works with extremely current lame > CVS, some things in lame were just fixed which would cause the current > code to crash in versions older than June 7. Talk about coincidences! I didn't have time until yesterday afternoon
2012 Aug 21
1
About matrix manipulation
Dear list, I'm trying to create a matrix by combining the sites that species occur in a new matrix with species as rows and sites as columns. The main matrix is "mat": mat <- as.data.frame(cbind(sp1=c(rep(0, 5), rep(1, 5)),sp2=sample(c(rep(0, 6),rep(1, 4))), fac=c(rep("a", 3), rep("b", 3),rep("c", 4)))) The first two columns are species and the
2012 Dec 05
3
data manipulation between vector and matrix
Dear list, I was curious how to subtract a vector from matrix? Say, I have mat <- matrix(1:40, nrow=20, ncol=2) x <-c(1,2) I want, x-mat[1,] and x-mat[2,], and so on... Basically, subtract column elements of x against column elements in mat. But x-mat won't do it. Thanks, Mike [[alternative HTML version deleted]]
2011 Feb 02
6
Backtrace in xen/next-2.6.38 when running guest
I get backtraces from the dom0 kernel when running a guest with networking (via netback) enabled such as the one below (there are some slight variations but the first two lines and most of the rest of the contents are the same). Michael Young BUG: sleeping function called from invalid context at mm/page_alloc.c:2190 in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper Pid: 0, comm:
2011 Apr 02
2
Matrix manipulation
Hi all! I have a vector, let's say for example int <- sample(1:20,10); for now: now I have a matrix... M = m x n where the first column is a "feature" column and most likely shares at least one of the int (interesting) numbers. I want to extract the rows where int[] = M[,1] I thought: rownames(int)<-int; rownames(M)<-M[,1]; M[rownames(int),] would work, but it
2009 Aug 06
1
creating MS Access query objects using RODBC
Hi - I'm trying to use R to create an MS Access query object. In particular, I would like to pass a given sql statement to a variety of Access files and have that sql statement saved as an Access Query in each db. Is this possible using R? I'm aware that I could use RODBC sqlQuery and write sql to make a table or that I could run the sql, extract it to R, and then use sqlSave to save the
2006 Nov 21
1
R-squared with and without constant
Greetings Listers! the R-squared value reported by summary of lm is calculated as 1 - RSS/RSS_m where RSS_m is the residual sum of squares of a minimal model. In most cases, the minimal model is simply y = mean(y), but when a constant is left out of the model, the minimal model is y = 0. However, if you manually add a constant, R still considers y = 0 the minimal model. This also causes
2010 Mar 29
2
Need help on matrix manipulation
Dear all, Ket say I have 3 matrices : mat1 <- matrix(rnorm(16), 4) mat2 <- matrix(rnorm(16), 4) mat3 <- matrix(rnorm(16), 4) Now I want to merge those three matrices to a single one with dimension 4*3=12 and 4 wherein on resulting matrix, row 1,4,7,10 will be row-1,2,3,4 of "mat1", row 2,5,8,11 will be row-1,2,3,4 of "mat2" and row 3,6,8,12 will be row-1,2,3,4 of