[R] Skipping rows and columns in large matrix
slomascolo at zoo.ufl.edu
Wed May 9 00:38:10 CEST 2007
yes, this works. I didn't think of concatenating... thanks!
jim holtman wrote:
> zzz <- zzz[-c(1,45,23,321), -c(23,34,45,67)]
> On 5/8/07, Silvia Lomascolo <slomascolo at zoo.ufl.edu> wrote:
>> I work on Windows, R version 2.4.1
>> I need to leave out many rows and columns when reading a matrix. The
>> commands in read.table, seem to be just for skipping rows, if I
>> well, but I need to skip many columns as well. I tried something very
>> and left one row and one column out, but I don't know how to do it for
>> rows and columns at a time.
>> zzz # euclidean distances matrix
>> X1 X2 X3 X4 X5
>> X1 0 11 12 1 15
>> X2 11 0 5 12 3
>> X3 12 5 0 8 4
>> X4 1 12 8 0 16
>> X5 15 3 4 16 0
>> skip.data = zzz [-3, -3] # gives me the same matrix without row 3 and
>> column 3... how can I tell R to skip more than one row and column?
>> and rows to be left out are not contiguous The matrix I'm using is
>> large (335x335), so excel won't read the whole thing, and it's not a
>> fixed-width txt file, so I cannot use read.fwf. I also don't have access
>> Unix, as was suggested to other users to solve this problem.
>> View this message in context:
>> Sent from the R help mailing list archive at Nabble.com.
>> R-help at stat.math.ethz.ch mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
> What is the problem you are trying to solve?
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
View this message in context: http://www.nabble.com/Skipping-rows-and-columns-in-large-matrix-tf3712332.html#a10385469
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help