Displaying 20 results from an estimated 10000 matches similar to: "r data structures"
2006 Nov 21
2
keeping dim() for array
Hi All,
I noticed the following:
pip = array(1:6, dim = c(3,2))
dim(pip)
[1] 3 2
pup = pip[1,]
dim(pup)
NULL
I bet there is a *good* reason why one row of an array is *dimensionless*, but
it's highly inconvenient for my purpose, i.e. to use apply() after an array goes
through a number of logical steps and is redimensioned, sometimes to one single row.
How do I keep dim(pup) to 1 2?
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
> On 1 Jun 2017, at 22:42, Roy Mendelssohn - NOAA Federal <roy.mendelssohn at noaa.gov> wrote:
>
> Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>
>>>> junk1 <- junk[, rev(seq_len(10), ]
>
>
> so that
>
> junk[1,1,1 ] = junk1[1,10,1]
> junk[1,2,1] =
2017 Jun 01
2
Reversing one dimension of an array, in a generalized case
My error. Clearly I did not do enough testing.
z <- array(1:24,dim=2:4)
> all.equal(f(z,1),f2(z,1))
[1] TRUE
> all.equal(f(z,2),f2(z,2))
[1] TRUE
> all.equal(f(z,3),f2(z,3))
[1] "Attributes: < Component ?dim?: Mean relative difference: 0.4444444 >"
[2] "Mean relative difference: 0.6109091"
# Your earlier example
> z <- array(1:120, dim=2:5)
>
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
On the off chance that anyone is still interested, here is the corrected function using aperm():
z <- array(1:120,dim=2:5)
f2 <- function(a, wh) {
idx <- seq_len(length(dim(a)))
dims <- setdiff(idx, wh)
idx <- append(idx[-1], idx[1], wh-1)
aperm(apply(a, dims, rev), idx)
}
all.equal(f(z, 1), f2(z, 1))
# [1] TRUE
all.equal(f(z, 2), f2(z, 2))
# [1] TRUE
2017 Jun 01
1
Reversing one dimension of an array, in a generalized case
Thanks again. I am going to try the different versions. But I probably won't be able to get to it till next week.
This is probably at the point where anything further should be sent to me privately.
-Roy
> On Jun 1, 2017, at 1:56 PM, David L Carlson <dcarlson at tamu.edu> wrote:
>
> On the off chance that anyone is still interested, here is the corrected function using
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
Here is an alternative approach using apply(). Note that with apply() you are reversing rows or columns not indices of rows or columns so apply(junk, 2, rev) reverses the values in each column not the column indices. We actually need to use rev() on everything but the index we are interested in reversing:
f2 <- function(a, wh) {
dims <- seq_len(length(dim(a)))
dims <-
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>>> junk1 <- junk[, rev(seq_len(10), ]
so that
junk[1,1,1 ] = junk1[1,10,1]
junk[1,2,1] = junk1[1,9,1]
etc.
The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, but all
2002 Oct 08
2
Samba password changes?
hi,
i've setup a LDAP server with account information,
and compiled samba with ldap support.
everything works great, except for the password changes
i still have to run two seprate commands ( passwd, smbpasswd )
to change a users password.
i've tried to put the pam_smbpasswd.so module into
system-auth, but that does work?
any pointers?
thanks
adriaan putter
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
??
> z <- array(1:24,dim=2:4)
> all.equal(f(z,3),f2(z,3))
[1] "Attributes: < Component ?dim?: Mean relative difference: 0.4444444 >"
[2] "Mean relative difference: 0.6109091"
In fact,
> dim(f(z,3))
[1] 2 3 4
> dim(f2(z,3))
[1] 3 4 2
Have I made some sort of stupid error here? Or have I misunderstood
what was wanted?
Cheers,
Bert
Bert Gunter
2015 Apr 29
1
Re: QemuDomainObjEndJob called when libvirtd is started and libvirt insists qemu is using the wrong disk source.
On 04/28/2015 05:13 PM, Laine Stump wrote:
> Bah. Your debug symbols aren't enough to give a full stack trace - what
> I was really looking for was those things marked as ??.
>
> However, your debug output shows several things leading up tothe
> qemuProcessStop that might have been the reason for it being called:
>
> 1) virStorageFileBackendFileReadHeader() complains
2005 Sep 26
2
constrOptim (PR#8158)
Full_Name: Haobo Ren
Version: 2.1.1
OS: Windows 2000
Submission from: (NULL) (192.11.226.116)
When running constrOptim, there is error message
Error: subscript out of bounds
2015 Apr 28
2
Re: QemuDomainObjEndJob called when libvirtd is started and libvirt insists qemu is using the wrong disk source.
On 04/22/2015 08:19 AM, Laine Stump wrote:
> If you're compiling yourself, then you should be all set to run under
> gdb. libvirt-debuginfo is just a separate subpackage that contains all
> the symbol and line number info from the build so that backtraces in
> gdb make sense. Try attaching gdb to the libvirtd process and do
> something like "thread apply all bt" - if
2012 Jun 15
3
moving from loops to apply
Dear subscribers,
I have made a simulation using loops rather than apply, simply because the loop function seems more natural to me. However, the current simulation takes forever and I have decided - finally - to learn how to use apply, but - as many other people before me - I am having a hard time changing habits. My current problem is:
My current code for the loop is:
distances <-
2006 Nov 09
2
Repeated Measures MANOVA in R
Can R do a repeated measures MANOVA and tell what dimensionality the statistical variance occupies?
I have been using MATLAB and SPSS to do my statistics. MATLAB can do ANOVAs and MANOVAs. When it performs a MANOVA, it returns a
parameter d that estimates the dimensionality in which the means lie. It also returns a vector of p-values, where each p_n tests
the null hypothesis that the mean
2003 Aug 19
9
Variance Computing- - HELP!!!!!!!!!!!!!!!!!!
Hello,
I am running a few simulations for clinical trial anlysis. I want some help
regarding the following.
We know trhat as the sample size increases, the variance should decrease, but
I am getting some unexpected results. SO I ran a code (shown below) to check
the validity of this.
large<-array(1,c(1000,1000))
small<-array(1,c(100,1000))
for(i in
2011 Nov 11
1
Fwd: Use of R for VECM
----- Forwarded Message -----
From: vramaiah at neo.tamu.edu
To: "bernhard pfaff" <bernhard.pfaff at pfaffikus.de>
Sent: Friday, November 11, 2011 9:03:11 AM GMT -06:00 US/Canada Central
Subject: Use of R for VECM
Hello Fellow R'ers
I am a new user of R and I am applying it for solving Bi-Variate (Consumption and Output) VECM with Co-Integration (I(1)) with three lags on
2002 Apr 26
9
[Fwd: Re: borrowing only from parent]
Martin Devera wrote:
> If you read the manual, the algorithm will not work correctly
> with {,c}burst < MTU ...
> devik
>
I just tried to change {,c}burst to 1600, or leaving them by default but
no visible result.
here is the latest tc -s -d class show dev eth0
class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 40Kbit burst 1599b/8
mpu 0b cburst 1599b/8 mpu 0b quantum 512 level
2006 Jun 02
1
Multivariate skew-t cdf
Dear All,
I am using the pmst function from the sn package (version 0.4-0). After
inserting the example from the help page, I get non-trivial answers, so
everything is fine. However, when I try to extend it to higher dimension:
xi <- alpha <- x <- rep(0,27)
Omega <- diag(0,27)
p1 <- pmst(x, xi, Omega, alpha, df = 5)
I get the following result:
>p1
[1] 0
attr(,"error")
2010 Jul 18
5
package "plotrix"
I installed package plotrix because reading its vignette it looks like it can help me solve a "legend" problem.
The package instaleed correctly on my Mac OS/X 10.5.8
But I cannot reproduce the examples centered on function "lgendg".
> library(plotrix)
> plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type="n",
+ main="Test of grouped legend function")
>
2002 Aug 25
3
Installing 2.2.5 latest on Mandrake 8
Hi there
I am a novice Linux user and am just trying it out - I am very impressed but
also very frustrated. I have loaded Mandrake 8 on a box and have configured
Samba for Windows pc's use this as a backup data server. Works
wonderfully - but our campus administrators say that the current version of
Samba presents a security risk(2.0.7) and should be upgraded. Thought this
was simple but