Displaying 20 results from an estimated 1000 matches similar to: "abind, but on lists?"
2008 Oct 28
2
abind
I am trying to combine two arrays with different dimensions into one.
For example
The first one is
1 2 3
4 5 6
The second one is
7 8
9 10
The resulted one would be like
, , 1
1 2 3
4 5 6
, , 2
7 8
9 10
I used abind to do this, but failed. Could somebody please let me
know how to do this in R? Thanks so many.
Suyan
2010 Nov 03
1
Recoding -- test whether number begins with a certain number
Dear R community,
I have a question concerning recoding of a variable. I have a data set
in which there is a variable devoted to the ISCO code describing the
occupation of this certain individual
(http://www.ilo.org/public/english/bureau/stat/isco/isco88/major.htm).
Every type of occupation begins with a number and every number added to
this number describes th occupation more detailed.
Now my
2008 Sep 08
13
list corner case
I'm curious how people think the following *should* be interpreted:
- one
2. two
http://babelmark.bobtfish.net/?markdown=-++one%0D%0A2.+two%0D%0A%0D%0A
As you can see, implementations split into three groups here:
(a) treat as an unordered list
Markdown.pl, Python markdown, MultiMarkdown, BlueCloth, MarkdownJ,
Showdown
(b) treat as an unordered list with an ordered
2006 May 02
2
Bug: invalid nesting of inline markup across link labels
Hi John,
there?s a bug in Markdown.pl:
[foo*bar](#) [baz*quux](#)
This expands to the following:
<p><a href="#">foo<em>bar</a> <a href="#">baz</em>quux</a></p>
Those `*` should either be disregarded or the tags should nest
correctly:
1. <p><a href="#">foo*bar</a> <a
2004 Mar 20
0
new version of abind()
There is a new version of the abind package on CRAN (abind_1.1-0). abind()
is a multi-dimensional generalization of cbind() and rbind() -- it can bind
multiple 2-d matrices into a 3-d array, or bind 3-d arrays together, etc.
In this new version the behavior of the function abind() has been enhanced
slightly (it can now accept a list as the first argument, removing the need
to use do.call()
2004 Mar 20
0
new version of abind()
There is a new version of the abind package on CRAN (abind_1.1-0). abind()
is a multi-dimensional generalization of cbind() and rbind() -- it can bind
multiple 2-d matrices into a 3-d array, or bind 3-d arrays together, etc.
In this new version the behavior of the function abind() has been enhanced
slightly (it can now accept a list as the first argument, removing the need
to use do.call()
2011 Oct 22
2
Expanding rows of a data frame into multiple rows
The setup: I have a data frame where one column is in list mode, and
each entry contains a vector of varying length.
I want to expand this into a data frame with one row for each member
of the list-mode column (the other values being replicated)
For example, an example input and the desired output would be:
input <- data.frame(site = 1:6,
sector =
2009 Aug 21
4
Where to put source code?
I'm trying to move from Matlab to R, and I'm stuck even getting
started. This sounds to me like the dumbest question in the world
but... how does one put R source code in files? Over the last three
days I've gone front to back through the Introduction to R and the R
Language Definition, and while I'm excited that the language is so
Lispish, none of what I read described how to
2006 Nov 23
2
loading libraries on MPI cluster
Dear R-users,
we are using library(snow) for computation on a linux cluster with RMPI.
We have a problem with clusterEvalQ: after launching clusterEvalQ it seems
loading the required library on each node but if we type a function
belonging to the loaded package R doesn't find it.
> library(snow)
# making cluster with 3 nodes
> cl <- makeCluster(3, type = "MPI")
Loading
2013 Jul 07
2
The *tmp* variable
When complex assignments are performed, the R interpreter creates, then
removes a special variable *tmp*. However, when byte compiling is enabled,
it seems that a different mechanism for making compound assignments is used.
Would it be possible to eliminate *tmp* from interpreted R code as well? It
might be useful for a function to lock its own environment, and the
appearance and disappearance of
2003 Oct 21
5
do.call() and aperm()
Hi everyone
I've been playing with do.call() but I'm having problems understanding it.
I have a list of "n" elements, each one of which is "d" dimensional
[actually an n-by-n-by ... by-n array]. Neither n nor d is known in
advance. I want to bind the elements together in a higher-dimensional
array.
Toy example follows with d=n=3.
f <-
2012 Apr 05
2
indexing data.frame columns
Consider the data.frame:
df <- data.frame(A = c(1,4,2,6,7,3,6), B= c(3,7,2,7,3,5,4), C =
c(2,7,5,2,7,4,5), index = c("A","B","A","C","B","B","C"))
I want to select the column specified in 'index' for every row of 'df', to
get
goal <- c(1, 7, 2, 2, 3, 5, 5)
This sounds a lot like the indexing-by-a-matrix
2018 Aug 13
2
substitute() on arguments in ellipsis ("dot dot dot")?
Interestingly,
as.list(substitute(...()))
also works.
On Sun, Aug 12, 2018 at 1:16 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 12/08/2018 4:00 PM, Henrik Bengtsson wrote:
>>
>> Hi. For any number of *known* arguments, we can do:
>>
>> one <- function(a) list(a = substitute(a))
>> two <- function(a, b) list(a = substitute(a), b =
2013 Apr 10
6
means in tables
Hi.
I have 2 tables, with same dimensions (8000 x 5). Something like:
tab1:
V1 V2 V3 V4 V5
14.23 1.71 2.43 15.6 127
13.20 1.78 2.14 11.2 100
13.16 2.36 2.67 18.6 101
14.37 1.95 2.50 16.8 113
13.24 2.59 2.87 21.0 118
tab2:
V1 V2 V3 V4 V5
1.23 1.1 2.3 1.6 17
1.20 1.8 2.4 1.2 10
1.16 2.6 2.7 1.6 11
1.37 1.5 2.0 1.8 13
1.24 2.9 2.7 2.0 18
I need generate a table of averages, the
2005 Apr 21
1
Installing packages from source code
Hi everybody,
I have trouble in installing packages from source code by following Section
5.1 in manual R-admin.pdf . I am using R 2.1.0 and Win NT.
Following the Windows toolset section in the manual, I download the tool
set package from: http://www.murdoch-sutherland.com/Rtools/tools.zip
and unzip under C:\tools
I also downloaded Perl (Windows Port) and installed it.
2011 Feb 14
3
help with aggregate()
Hi,
I am trying to aggregate some data and I am confused by the results.
I load a data frame "all" from a csv file, and then I do:
(FOO,BAR,X,Y come from the header line in the csv file,
BTW, how do I rename a column?)
byFOO <- aggregate(list(all$BAR,all$QUUX,all$X/all$Y),
by = list(FOO=all$FOO),
FUN = mean);
I expect a data frame with 4
2011 Aug 12
1
install packages from intranet
Hi,
I'm new to R. Apologies if this is a simple query, I've searched the mailing lists and docs but can't find a solution to my problem.
I'm trying to make some packages available on our intranet. During development the 'intranet' is a webserver running on localhost.
* When I call "install.packages" I get a mesage about not being able to access 'index
2005 Oct 21
1
Generalised rbind/cbind
Dear list,
Is there a generalised form of rbind/cbind for combining
matrices/arrays into higher-D structures? ie. if I have:
a <- matrix(2,2,2)
b <- matrix(3,2,2)
how can I get
array(rep(c(3,2), each=4), c(2,2,2))
?
It seems like this would be the job of a generalised abind function:
abind(a,b, along=1) == rbind(a,b)
abind(a,b, along=2) == cbind(a,b)
abind(a,b, along=3)
2005 May 21
2
Possible (ab)use of lexical scoping in R ?
Dear list,
I wish to define a set of functions *auxilliary* to another set of
"main" ones, and I wonder if there is some "clever" way do do this using
lexical scoping. Looking for that in the list's archives did not get me
easily understood answers. Perusing MASS (1st, 2nd, 3rd and 4th
editions!) and "Programming S" wasn't of much help either...
R easily
2009 Oct 18
2
rbind to array members
Hi,
I would like to add rows to arbitrary tables within a 3dimensional array.
I can directly add data to an existing row of a table:
> x <- array(0,c(1,3,2))> x[,,1] <- c(1,2,3)
And I can even add a row to the table and assign to another object.
> y <- rbind(x[,,1], c(4,5,6))
and 'y' is what I want it to be:> y?? ? [,1] [,2] [,3][1,] ? ?1 ? ?2 ? 3[2,] ? ?4 ? ?5 ? 6
but