Hi Thomas,
This is non trivial to do, but if you will be working with this sort
of data and are inclined to do some programming, you might consider
creating a new class. S4 classes and methods are quite flexible, and
you can allow them to lean on or inherit from existing classes such as
matrices.
To second Bert Gunter: you may get better answers if you give us a complete
description.
On Thu, Jul 5, 2012 at 12:37 PM, Thomas C. wrote:
> i have number of triangles which i'd like to store in a list,
> matrix,...etc.
> i thought it could look sth. like that:
>
> trianglenode1
You have failed to provide a complete, coherent description of what you
wish to do. In the absence of such a description, all suggestions are just
guesses. You need to think carefully about what information you want to
associate with each triangle and the appropriate data structure to use to
do thi
$ a: int 1 2 3 4 5 6 7 8 1 2 ...
$ b: int NA NA 5 6 7 NA NA NA NA NA ...
$ c: int NA 1 2 3 4 NA NA NA NA NA ...
z2<-as.matrix(z)
A.K.
- Original Message -
From: Thomas C.
To: r-help@r-project.org
Cc:
Sent: Thursday, July 5, 2012 9:19 AM
Subject: [R] vector entry in matix
hi,
i
well thank you, i think we get closer to my problem. but i meant it in a
different way. maybe i describe what i intended to do:
i have number of triangles which i'd like to store in a list, matrix,...etc.
i thought it could look sth. like that:
trianglenode1node2no
On Jul 5, 2012, at 11:22 AM, R. Michael Weylandt wrote:
It is possible to put dimensionality on a list (i.e., a generic
vector), which might be what you're looking for.
x <- list(1:4, letters[1:4], function(x,y) x + y, rnorm(50))
dim(x) <- c(2,2)
x[[1,2]]
x[[2,2]]
x[[3,2]] # Error
That co
It is possible to put dimensionality on a list (i.e., a generic
vector), which might be what you're looking for.
x <- list(1:4, letters[1:4], function(x,y) x + y, rnorm(50))
dim(x) <- c(2,2)
x[[1,2]]
x[[2,2]]
x[[3,2]] # Error
Best,
Michael
On Thu, Jul 5, 2012 at 8:19 AM, Thomas C. wrote:
> h
hi,
i'm trying to figure out if there's any possibility to write a whole vector
into a matrix or data.frame or something like that. i don't mean
transormation. Here an example:
[,1] [,2]
[1,] "a" "d"
[2,] "b" "e"
[3,] "c" "f"
where e.g. a is a<-c(0,1) vector of length 2, b a vector of
8 matches
Mail list logo