Displaying 20 results from an estimated 7000 matches similar to: "Is simplify2array working for dimension > 2?"
2024 Feb 08
1
Is simplify2array working for dimension > 2?
Jean-Claude:
Well, here's my "explanation". Caveat emptor!
Note that:
"simplify2array() is the utility called from sapply() when simplify is
not false"
and
> sapply(a, I, simplify = "array")
[,1] [,2]
[1,] list,2 list,2
[2,] list,2 list,2
So it seems that simplify2array() is not intended to operate in the
way that you expected, i.e. that recursive
2017 Apr 27
2
Error with installed.packages with R 3.4.0 on Windows
Hello,
I am currently getting a strange error when I call installed.packages():
Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && :
missing value where TRUE/FALSE needed
Calls: installed.packages
I am working with R 3.4.0 on Windows. I didn't get this error with R 3.3.3.
Apparently, file.mtime() is returning NA well applied to a directory, and
2012 Oct 11
1
simplify2array edge case
Should simplify2array(higher=TRUE) treat 1 by 1 matrices differently than others?
I expected a 3-dimensional array from all of the following 3 examples, not just the last 2.
> str(simplify2array(list(array(11,c(1,1)), array(21,c(1,1))), higher=TRUE))
num [1:2] 11 21
> str(simplify2array(list(array(11:13,c(3,1)), array(21:23,c(3,1))), higher=TRUE))
int [1:3, 1, 1:2] 11 12 13 21 22
2014 Mar 27
2
mclapply Segmentation Fault for Ubuntu
Running the example in the documentation causes R to crash.
dario at bioinfo:~$ R
R version 3.0.3 (2014-03-06) -- "Warm Puppy"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or
2011 Aug 10
3
convert 'list' to 'vector'?
Dear all
How does one convert a "non-symmetric" list to a vector? See below:
> x <- list()
> x[[1]] <- letters[1:5]
> x[[2]] <- letters[6:10]
> x[[3]] <- letters[11:12]
> x
[[1]]
[1] "a" "b" "c" "d" "e"
[[2]]
[1] "f" "g" "h" "i" "j"
[[3]]
[1] "k"
2013 Aug 26
1
Loop for converting character columns to Numeric
Hi,
Suppose you created a dataframe like this:
set.seed(28)
?dat1<-as.data.frame(simplify2array(list(letters[1:5],sample(1:20,5,replace=TRUE),6:10)),stringsAsFactors=FALSE)
?str(dat1)
#'data.frame':??? 5 obs. of? 3 variables:
# $ V1: chr? "a" "b" "c" "d" ...
# $ V2: chr? "1" "2" "10" "18" ...
# $ V3: chr?
2013 Feb 14
3
list of matrices --> array
i'm somehow embarrassed to even ask this, but is there any built-in
method for doing this:
my_list <- list()
my_list[[1]] <- matrix(1:20, ncol = 5)
my_list[[2]] <- matrix(20:1, ncol = 5)
now, knowing that these matrices are identical in dimension, i'd like
to unfold the list to a 2x4x5 (or some other permutation of the dim
sizes) array.
i know i can initialize the array, then
2018 Mar 13
4
Possible Improvement to sapply
While working with sapply, the documentation states that the simplify argument will yield a vector, matrix etc "when possible". I was curious how the code actually defined "as possible" and see this within the function
if (!identical(simplify, FALSE) && length(answer))
This seems superfluous to me, in particular this part:
!identical(simplify, FALSE)
The preceding
2018 Mar 13
0
Possible Improvement to sapply
Wouldn't that change how simplify='array' is handled?
> str(sapply(1:3, function(x)diag(x,5,2), simplify="array"))
int [1:5, 1:2, 1:3] 1 0 0 0 0 0 1 0 0 0 ...
> str(sapply(1:3, function(x)diag(x,5,2), simplify=TRUE))
int [1:10, 1:3] 1 0 0 0 0 0 1 0 0 0 ...
> str(sapply(1:3, function(x)diag(x,5,2), simplify=FALSE))
List of 3
$ : int [1:5, 1:2] 1 0 0 0 0 0 1 0 0
2018 Mar 13
1
Possible Improvement to sapply
You?re right, it sure does. My suggestion causes it to fail when simplify = ?array?
From: William Dunlap [mailto:wdunlap at tibco.com]
Sent: Tuesday, March 13, 2018 12:11 PM
To: Doran, Harold <HDoran at air.org>
Cc: r-help at r-project.org
Subject: Re: [R] Possible Improvement to sapply
Wouldn't that change how simplify='array' is handled?
> str(sapply(1:3,
2013 Sep 10
3
to delete lines by means of a vector
Hi
I would like to eliminate a large number of lines of the dataframe df1
The lines to delete are given here by the values of Mat (ex : 2,4,7,10).
but I have a large number (300) values of Mat
dput(df1)
structure(list(Mat = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3,
3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7,
7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10,
10, 11,
2018 Mar 13
0
Possible Improvement to sapply
On 03/13/2018 09:23 AM, Doran, Harold wrote:
> While working with sapply, the documentation states that the simplify argument will yield a vector, matrix etc "when possible". I was curious how the code actually defined "as possible" and see this within the function
>
> if (!identical(simplify, FALSE) && length(answer))
>
> This seems superfluous to me,
2005 Aug 02
3
Scriptaculous: Sortable (dragdrop.js) onUpdate
Hi all,
In the following code, it doesn''t look like the onUpdate() event is firing.
Am I doing something wrong?
<ul id="testSort">
<li id="item1">item 1</li>
<li id="item2">item 2</li>
<li id="item3">item 3</li>
<li id="item4">item 4</li>
<li id="item5">item
2009 Jun 20
1
Transfer incomming email to INBOX
I've installed dovecot with maildir format in /home/claude/mail.
I fetch my email with fetchmail and they are placed in
/var/spool/mail/claude.
How can I transfer them automatically in /home/claude/mail/INBOX/new
How can I setup something to transfer my email automatically as they
arrive.
Claude
2018 Mar 13
2
Possible Improvement to sapply
Martin
In terms of context of the actual problem, sapply is called millions of times because the work involves scoring individual students who took a test. A score for student A is generated and then student B and such and there are millions of students. The psychometric process of scoring students is complex and our code makes use of sapply many times for each student.
The toy example used
2015 Apr 17
3
Redefining {
I am curious if anyone knows of R code where the "{" function is
redefined in a useful way. Or "(" for that matter.
Thanks
Mick
2005 Feb 21
2
1.1.6 Manual sampledec.c mistake
Le lundi 21 f?vrier 2005 ? 15:08 +0100, Claude Brisson a ?crit :
> Why not move the manual on the wiki ?
Because it's already written in LyX and can be easily converted to pdf,
html or anything. However, the trouble shooting part could be on a wiki.
Do you volunteer?
Jean-Marc
> Claude
>
> On Mon, 2005-02-21 at 21:35 +0800, James Oh wrote:
> > Hi,
> >
> >
2005 Jan 10
2
64 bit integer spx_word64_t
On Tue, 2005-01-11 at 02:07 -0500, Jean-Marc Valin wrote:
> > noticed there's a 64 bit integer being used in the long term prediction.
> > any chance of using a 32 bit integer without incurring some major side-effects?
>
> A 32-bit integer may overflow (which is why I used a 64-bit int). Of
> course, it's possible to emulate it using 32-bit arithmetic. Otherwise,
>
2010 Jul 01
2
[LLVMdev] Fail to unroll loop on simple examples.
Hi all,
I have tried to use the loop-unroll pass on a large example, but without
success. So I have tried on smaller examples, and I did not get more
success.
My simplest example is attached. It comes from this C code (using llvm-gcc,
but similar result with clang):
int main (int argc, char *argv[]) {
int i;
for (i = 0; i!=5; ++i) {}
return 0;
}
I use this command (version 2.8svn, from
2013 Apr 25
2
Decomposing a List
Greetings!
For some reason I am not managing to work out how to do this
(in principle) simple task!
As a result of applying strsplit() to a vector of character strings,
I have a long list L (N elements), where each element is a vector
of two character strings, like:
L[1] = c("A1","B1")
L[2] = c("A2","B2")
L[3] = c("A3","B3")