search for: array1

Displaying 20 results from an estimated 31 matches for "array1".

Did you mean: array
2006 Sep 08
2
Multiple matrix multiplication with two 3-dimensional arrays
Hi, I need to do several matrix multiplications with the corresponding matrices forming two 3-dimentional arrays. To illustrate my problem, let's say I have the following 3-dimensional arrays: array1 <- array(1:30,dim=c(3,2,5)) array2 <- array(1:20,dim=c(2,2,5)) I know that I can get what I want with the following computation : result <- array(dim=c(dim(array1)[1], dim(array2)[2], dim(array1)[3])) for (i in 1: dim(array1)[3]) { result[,,i] <- array1[,,i]%*%array2[,,i]...
2013 Aug 29
10
Concatenate two arrays
Hello again ruby community! I just learned how to add two arrays(I know, i know). My program looked like this array1=[1,2,3] array2=[4,5,6] array_sum=array1+array2 I thought pretty simple stuff, they are combined. However, now i am looking to define that code as a method and I do not understand how to create the correct number of arguments, so when the method is called back it gives me my array_sum. I have been...
2010 Aug 31
4
pasting together 2 character arrays
If possible I would like to combine two different character arrays in combinations Array1 <- c("height","weight","age","sex") Array2 <- c("trt0","trt1","trt2") I would like to combine these two character vectors to end up with such ... Array3 "height.trt0.trt1" "height.trt0.trt2" "we...
2010 Mar 16
2
Help running a Fortran subroutine from R
...ter to (time702.txt). Here is what I am doing... > dyn.load("C:/f/NEW/filter2d.dll") > is.loaded("filter2d") [1] TRUE Then I pass the parameters according to the order they are specified in the filter: array <- data.matrix(read.table("time702.txt",header=F)) array1 <- array nx <- 60 ny <- 120 halfintx <- 3 halfinty <- 3 mask <- matrix(array(rep(1.0,25)),5,5) subarray <- matrix(0,5,5) subarray1 <- matrix(0,5,5) Then I run the Fortran subroutine... out <- .Fortran("filter2d", as.single(array), as.single(a...
2007 Aug 18
1
doubt about string comparison
I have two large arrays of strings array1 with 180000 names and array2 with 24000 names ,I want to find the common names in both of them. My arrays are for example Array1 Array2 GAP4 HIST1B-histamine.... MFG12 SNRPD-...
2014 May 22
2
[LLVMdev] RFC: Indexing of structs vs arrays in getelementpointer
...} %array1 = type [2 x i32] %array2 = type [2 x %array1] ; Function Attrs: ssp uwtable...
2007 Jan 10
2
correlation value and map
Dear R-help community, I have 2 different arrays of precipitation data each of the same dimensions of [longitude, latitude, time] dim=[30,32,43], called array1 and array2. I need to correlate them. This is the code I used to get one overall correlation value for the whole of the area of interest: > result <- cor(array1,array2,use="complete.obs") > result This give me a single value but I'm not convinced it is actually a correlat...
2011 Sep 22
2
create variables through a loop
HI, Dear R community, I am trying to created new variables and put into a data frame through a loop. My original data set: head(first) probe_name chr_id position array1 1 C-7SARK 1 849467 10 2 C-4WYLN 1 854278 10 3 C-3BFNY 1 854471 10 4 C-7ONNE 1 874460 10 5 C-6HYCN 1 874571 10 6 C-7SCGC 1 874609 10 I have 48 other array data from a list result.fun array2=result.fun[[1]] array3=r...
2006 Jun 16
0
a method to trim composite objects?
dear R users, please, consider the following code you may run: setClass("my.class1", representation( my.list = "list", my.array1 = "array"), prototype=prototype( my.list =list(), my.array1 =array(0,c(3,3,3)) )) #------------------ setClass("my.class2", representation( my.array2 = "array", my...
2008 Mar 27
1
Nothing happened when I using t.test throuth RSPerl
Hi, I've just started using RSPerl. Though also tests in directory "/usr/local/lib/R/library/RSPerl/tests/" are passed successfully, I meet the problem with the following codes; use strict; use warnings; use R; use RReferences; my @array1=1..10; my @array2=1..39; &R::initR("--silent"); &R::library("RSPerl"); my $tt=&R::call("t.test", (\@array1, \@array2)) print $tt; I got the messages: Can't locate package RFunctionReference for @RReferences::ISA at testR.pl line 4. Use of uninitialize...
2009 Jul 15
0
Fwd: DLLs
...a piece of code that runs fine when the library is not loaded. Any hints about where to look to solve this problem would be much appreciated. Robin Cowan Here is the simple Pascal code: Running on a Macintosh Intel, OS X 10.5, R 2.9.1 {$MODE DELPHI} library LearningLib; const num=75; type array1= array[1..2,1..num] of Double; array2=array[1..num,1..num] of longint; array3=array[1..num,1..num] of Double; array4=array[1..num] of longint; pA1=^array1; pA2=^array2; pA3=^array3; pA4=^array4; pD=^Double; procedure learning(loc1:pA1;adj1:pA2;alpha:pD); cdecl; var i1,i2,neighs:longint; sum1,sum2:...
2007 May 18
2
files deleted without --delete option
...sync the files on the DST side are deleted if they were deleted from the SRC side. What am I doing wrong? I am running the following command: ======================================================== rsync -avz --progress --force --delete-excluded --exclude-from=exclude.txt myroot@192.168.1.2:/mnt/array1/ /mnt/harddisk3/ ======================================================== This is what is in my exclude file: ======================================================== debian:/home/jchaven/scripts# cat exclude.txt thumbs.db Thumbs.db Temp/ debian:/home/jchaven/scripts# ============================...
2009 Jul 03
1
Dynamic libraries
...nts). Anyone have experience with this sort of thing? Thanks, Robin Cowan Sample below: This one works fine: library Test1Lib; type pA=^integer; procedure simple(x:pA); cdecl; var i1,i2:integer; begin x^:=x^*2; end; exports simple; begin end. This one does not: library Test2Lib; type array1=array[1..5] of integer; pA=^array1; procedure simpleArray(x:pA); cdecl; var i1:integer; begin for i1:=1 to 5 do x^[i1]:=x^[i1]*2; end; exports simpleArray; begin end. Here is the wrapper I use: MySimple <- function(x) { ans <- .C("simple",as.integer(x)) # or simpleArray in...
2007 Jan 03
2
accessing arrays
...all. how can i adress a array directly. for example i wanna give array 1 other labels than array 2. How can I overcome this problem? ...this doesn't work tab <- array(1:8, c(2, 2, 2)) dimnames(tab[,,1]) <- list(c("No","Yes"), c("No","Yes"),c("ARRAY1")) dimnames(tab[,,2]) <- list(c("big","small"), c("small","big"),c("ARRAY2")) -- View this message in context: http://www.nabble.com/-R--accessing-arrays-tf2913929.html#a8142071 Sent from the R help mailing list archive at Nabble.com.
2005 Jun 14
1
t.test using RSPerl
Hi, I've just started using R and RSPerl. I have some code as follows: &R::initR("--no-save"); &R::call("t.test", (\@array1, \@array2)); where @array1 and @array2 are both 1-dimensional arrays in Perl having 54675 elements each. On execution the output is as follows: Calling R function name `t.test', # arguments: 3 1) Arg type 3 Got a reference to a value 10 Here now!2) Arg type 3 Got a reference to a value 10 H...
2014 May 23
2
[LLVMdev] RFC: Indexing of structs vs arrays in getelementpointer
...t2* %dm, i64 %tmp9, i32 1 > br label %bb3 > > bb3: ; preds = %bb2, %bb1 > %phi = phi %struct1* [ %tmp10, %bb1 ], [ %tmp20, %bb2 ] > %tmp24 = getelementptr inbounds %struct1* %phi, i64 0, i32 1 > > %tmp25 = load i32* %tmp24, align 4 > ret i32 %tmp25 > } > > > %array1 = type [2 x i32] > %array2 = type [2 x %array1] > > ; Function Attrs: ssp uwtable > define i32 @test2(%array2* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19) { > bb: > br i1 %tmp4, label %bb1, label %bb2 > bb1: ; preds = %bb5 > %tmp10 = getelementptr inbounds %array2* %dm, i64 %tmp9...
2016 Mar 04
3
ALLOCATE in a FORTRAN subroutine
...39; array in a FORTRAN subroutine and to make it be read by R ? Or is it possible to have a 'pointer' in R, to give it to the FORTRAN subroutine where an ALLOCATE can create the array and then R works with the array ? The other solution, is to work with dummies dimension in FORTRAN (REAL*8 array1(*)) but can R work with that ? TIA Jean -------------- next part -------------- Ce message et toutes les pi?ces jointes (ci-apr?s le 'Message') sont ?tablis ? l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisat...
2006 Jul 26
1
Calling another method in the same controller
Hi, probably this is realy simple, but for some reason i don''t see it. probably i still don''t think object orriented :) lets say i have a piece of code which generates an array based on a few inputs. within a controller i want to use this code to generate three arrays, all based on different input variables how do i do that? can i call another method within a method? if so,
2011 Aug 22
1
select columns array2 not equal to 10
Dear R community, I have a data set like the following: probe_name chr_id position array1 array2 array3 array4 array5 array6 array7 1 C-3AAAA 10 16566949 10 10 10 10 10 10 10 2 C-3AAAB 17 33478940 10 10 10 10 10 10 10 3 C-3AAAC 3 187369224 10 10 2 10 10 1 10 4 C-3AAAD 8 28375041...
2016 Mar 04
0
ALLOCATE in a FORTRAN subroutine
Hi, Until you get a more definitive answer, I will make an attempt to give some advice. When using an assumed sized array (i.e. REAL*8 array1(*)) you still need to allocate the memory prior to calling the Fortran subroutine, so you would still need to know its maximum length. Arrays created in a Fortran subroutine via the use of the ALLOCATE statements are not simple arrays (in the sense of C like pointers), but are more akin to a C str...