Displaying 20 results from an estimated 6000 matches similar to: "avoiding loops, gaining generality"
2005 Mar 28
2
Generating list of vector coordinates
Hi.
Can anyone suggest a simple way to obtain in R a list of vector
coordinates of the following form? The code below is Mathematica.
In[5]:=
Flatten[Table[{i,j,k},{i,3},{j,4},{k,5}], 2]
Out[5]=
{{1,1,1},{1,1,2},{1,1,3},{1,1,4},{1,1,5},{1,2,1},{1,2,2},{1,2,3},{1
,2,4},{1,2,
5},{1,3,1},{1,3,2},{1,3,3},{1,3,4},{1,3,5},{1,4,1},{1,4,2},{1,4,3},
{1,4,
2013 Apr 14
1
R 3.0.0 memory use
I did some benchmarking of data frame code, and
it appears that R 3.0.0 is far worse than earlier versions of R
in terms of how many large objects it allocates space for,
for data frame operations - creation, subscripting, subscript replacement.
For a data frame with n rows, it makes either 2 or 4 extra copies of
all of:
8n bytes (e.g. double precision)
24n bytes
32n bytes
2008 May 13
2
Permutations
Dear R-users,
Is there an easy way to determine all possible vectors of length 21 with
each entry having permutations from 0 to 4, instead of doing it like this?
It really takes up too much time, and I am convinced that there exists
something easier.
Can you help me? Thank you in advance!
Kind regards,
Elke
for (a in 0:4){
for (b in 0:4){
for (c in 0:4){
for (d in 0:4){
2004 Nov 04
3
keep dimension of a sub matrix
Hi,
is there any way to keep a sub matrix dimension?
exemple :
i1<-1; i2<-1
j1<-2; j2<-3;
ret <-matrix(1,4,4)[i1:i2,j1:j2] ;
dim(ret) is NULL because the submatrix single col or single row is coerce to a vector automaticaly.
How can i bypass this cast : submatrix->vector ???????
Thank you.
---------------------------------
[[alternative HTML version
2009 Feb 04
7
counting entries in vector
Hi all,
I've a vector with entries, which are all of the same type, e.g. string:
k <- c("bb", "bb", "bb", "aa", "cc", "cc")
and want to create a second vector containing the number of each entry
in k in the same order as in k, i.e.
c(3, 1, 2)
or:
k <- c(5,5,5,5,2,2,4)
=> c(4,2,1)
thanks
2018 May 23
3
find the permutation function of a sorting
Thanks, David.
I got the answer from the web.
Is there any easy way to permute a set (e.g., a set of characters) by the
permutation it returns? Thanks,
> x <- c(10,7,4,3,8,2)
> sort(x, index.return=TRUE)
$x
[1] 2 3 4 7 8 10
$ix
[1] 6 4 3 2 5 1
2018-05-23 10:49 GMT+08:00 David Winsemius <dwinsemius at comcast.net>:
>
>
> > On May 22, 2018, at 10:06 PM, John
2007 May 21
3
an array of matrices
I'd like to have a three dimensional array of matrices. I thought I could construct a five dimensional array to have the three dimensional array of matrices. However, not all of the matrices in the array have the same dimensions, which seems to mean I can't use a five dimensional array.
What I'd like is this:
A = matrix(1:4,2,2)
B = matrix(1:25,5,5)
C = matrix(1,3,3)
D =
2018 May 23
2
find the permutation function of a sorting
Hi,
Is there any way to find the permutation function of the sorting and to
apply the function (or its inverse) elsewhere?
For example, the following permutation function from the sorting in the
matrix form is
c(1,2,3), c(2,1,3)
> sort(c("bc","ac","dd"))
[1] "ac" "bc" "dd"
I try to find it in the permutations/permute
2006 Aug 18
1
Permutations with replacement
Is there a simple function or process that will create a matrix of
permutations with replacement?
I know that using the combinat package
###### begin R code ######
> library(combinat)
> m <- t(array(unlist(permn(3)), dim = c(3, 6)))
# we can get the permutations, for example 3!=6
# gives us
> m
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 1 3 2
[3,] 3 1 2
[4,]
2008 Mar 18
0
Gaining access to complex LAPACK functions
Hello,
I am using R version 2.6.2 on Windows XP. I installed R using the installation file provided through one of the CRAN mirrors; I did not build it myself. as a result, the LAPACK functionality is limited. I'm trying to install a package that requires access to complex LAPACK functions that are not provided in the LAPACK library that is included in the basic installation of R; this is
2018 Dec 20
0
Samba-created files with POSIX ACLs gaining execute bit
On Thu, 20 Dec 2018 01:32:16 -0800
christian russell <christian.baltini at gmail.com> wrote:
> Hi Rowland, I see the typo now too — I retyped it from scratch … oops.
>
> Here it is.
>
> [global]
> workgroup = HOME
> netbios name = IPA
> realm = HOME.FRAPLIN.FUN
> kerberos method = dedicated keytab
> dedicated keytab file =
2018 May 23
0
find the permutation function of a sorting
> On May 22, 2018, at 10:57 PM, John <miaojpm at gmail.com> wrote:
>
> Thanks, David.
> I got the answer from the web.
> Is there any easy way to permute a set (e.g., a set of characters) by the permutation it returns? Thanks,
>
>
> > x <- c(10,7,4,3,8,2)
> > sort(x, index.return=TRUE)
> $x
> [1] 2 3 4 7 8 10
>
> $ix
> [1] 6 4 3 2
2011 May 13
4
Gaining performance by disabling functionality?
As most Wine users probably know, running applications using Wine won't (in most cases) give you the same performance as running the application in native Windows. From my experience this is especially true when it comes to applications that make use of Direct3D, and I suppose the performance drop is (at least in part) due to the translation of Direct3D to OpenGL in Wine.
Now, this got me
2018 May 23
3
find the permutation function of a sorting
> sort(c("bc","ac","dd"), index.return=TRUE)
$x
[1] "ac" "bc" "dd"
$ix
[1] 2 1 3
We have the permutation, namely 1-->2, 2-->1, 3-->3.
How can I apply the permutation function to a new set
c("D","E", "F")?
so that the result is
c("E","D", "F").
2018-05-23 11:06
2009 Jul 09
1
Converting indices of a matrix subset
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have two matrices:
> m1 <- matrix(1,4,4)
> m1
[,1] [,2] [,3] [,4]
[1,] 1 1 1 1
[2,] 1 1 1 1
[3,] 1 1 1 1
[4,] 1 1 1 1
> m2 <- matrix(0,3,3)
> diag(m2) <- 1
> m2
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1
I want to get indicies from m2
2018 Dec 18
0
Samba-created files with POSIX ACLs gaining execute bit
These are the latests.. And the Why, Andrew already explain.
Due to the mappings with windows acls.
If the exec bit is missing, no windows programm will be allowed to start of a share.
If i download an msi file to install and put it on a share, its not allowed to execute it.
Which is exact what i want in my case.
You might want to read
2012 Aug 28
5
return first index for each unique value in a vector
I would like to efficiently find the first index of each unique value in a
very large vector.
For example, if I have a vector
A<-c(9,2,9,5)
I would like to return not only the unique values (2,5,9) but also their
first indices (2,4,1).
I tried using a for loop with which(A==unique(A)[i])[1] to find the first
index of each unique value but it is very slow.
What I am trying to do is easily
2016 May 18
3
sum elements in the vector
Hi Rail,
We used a very simple pattern expansion (actually, not a pattern fragment). For example, for AND, ADD (horizontal sum), OR and XOR of 4 elements we use something like the following TableGen structure:
class HORIZ_Op4<SDNode opc, RegisterClass regVT, ValueType rt, ValueType vt, string asmstr> :
SHAVE_Instr<(outs regVT:$dst), (ins VRF128:$src),
2018 Dec 20
3
Samba-created files with POSIX ACLs gaining execute bit
Hello Marco,
I am speaking about POSIX ACLs, yes.
When I create a file via shell I get a 660 file.
When I create a file via Samba I get a 770 file.
I don’t understand why they would be different. Without ACLs shell / Samba created files get consistent permissions.
Christian
> On Dec 20, 2018, at 12:29 AM, Marco Gaiarin via samba <samba at lists.samba.org> wrote:
>
> Mandi!
2012 Oct 14
6
transforming a .csv file column names as per a particular column rows using R code
Hello all,
I have a .csv file like below.
Tool,Step_Number,Data1,Data2... etc up to 100 columns.
A,1,0,1
A,2,3,1
A,3,2,1
.
.
B,1,3,2
B,2,1,2
B,3,3,2
.
.
...... so on upto 50 rows
where the column "*Tool*" has distinct steps in second column
"*Step_Number*",but both have same entries in Step_Number column.
I want the output like below.