similar to: Getting elements of a matrix by a vector of column indice s

Displaying 20 results from an estimated 10000 matches similar to: "Getting elements of a matrix by a vector of column indice s"

2009 Mar 20
4
how to make aggregation in R ?
Hi, I am trying to aggregate the sum of my test data.frame as follow: testDF <- data.frame(v1 = c("a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "d", "d", "d", "d",
2003 Oct 27
2
how to select random rows ?
How can I select random subsets (rows!) from a data set ? If I generate simple data set > a <- data.frame(x=1:2, y = NaN, z = 2:1) > a x y z 1 1 NaN 2 2 2 NaN 1 I can select random subsets (colums) very easily using sample function: > sample(a, 2) z y 1 2 NaN 2 1 NaN I expected that using transpose of a would do the same for rows, but I am getting rather unexpected
2005 Aug 13
1
How to change the names in tone pitch column
Hi, I have a column (V4) in a midi event list which includes tone pitch names, i.e. "A4, E4, C#4, A3...": > compo[1:10,] V1 V2 V3 V4 V5 V6 V7 1 1 1 0 A4 96 2 0 2 1 1 0 E4 96 2 0 3 1 1 0 C#4 96 2 0 4 1 1 0 A3 96 2 0 5 1 3 0 B4 96 1 0 6 1 3 0 E4 96 1 0 7 1 3 0 B3 96 1 0 8 1 3 0 G#3 96 1 0 9 1 4 0 C#5 96 1 0 10
2017 Nov 24
1
SSL configuration
Hello subscribers, I have a very strange question regarding SSL setup on gluster storage. I have create a common CA and sign certificate for my gluster nodes, placed host certificate, key and common CA certificate into /etc/ssl/, create a file called secure-access into /var/lib/glusterd/ Then, I start glusterd on all nodes, system work fine, I see with peer status all of my nodes. No problem.
2008 Dec 09
1
creating standard curves for ELISA analysis
Hello R guru's I am a newbie to R, In my research work I usually generate a lot of ELISA data in form of absorbance values. I ususally use Excel to calculate the concentrations of unknown, but it is too tedious and manual especially when I have 100's of files to process. I would appreciate some help in creating a R script to do this with minimal manual input. s A1-G1 and A2-G2 are
2005 Feb 13
2
3.0.11/MirOS password change problem
Hi! Does this sound familiar, before I try to look deeper into it? [2005/02/13 20:10:16, 0] /usr/ports/net/samba/w-samba-3.0.11/samba-3.0.11/source/libsmb/smbencrypt.c:decode_pw_buffer(539) decode_pw_buffer: incorrect password length (1251354155).
2003 Dec 15
2
3.0.1rc2 LDAP - problems joining domain
Hi, I'm back on the list ;-) I seem to be having some trouble getting W2K machines to join the domain in 3.0.1rc2. I haven't looked at this in detail since 2.2.8a but it looks like the account gets created in LDAP and then it has trouble setting the password appropriately. I believe this is the relevant part of the log: api_rpcTNP: samr op 0x3a - api_rpcTNP: rpc command:
2011 Aug 27
3
all combinations of the elements of two vectors
Dear R-help readers, I'm sure this problem has been answered but I can't find the solution. I have two vectors v1 <- c("a","b") v2 <- c(1,2,3) I want an easy way to produce every possible combination of v1, v2 elements Ie I want to produce c("a1","a2","a3", "b1","b2","b3") regards Desmond Desmond
2005 Jun 03
2
rearrange data
Dear all: I have this: A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3 And I want this A1 E1 B1 E1 C1 E1 D1 E1 A2 E2 B2 E2 C2 E2 D2 E2 A3 E3 B3 E3 C3 E3 D3 E3 Example: m<- matrix(1:15,nrow=3,byrow=T) m v<- unlist(list(t(m[,1:4]))) u<- rep(c(5,10,15),c(4,4,4)) data.frame(v,u) This is the result I want but I would like to learn a simpler way to do it. Any clue?
2011 Mar 05
2
Repeating the same calculation across multiple pairs of variables
Hi all, I frequently encounter datasets that require me to repeat the same calculation across many variables. For example, given a dataset with total employment variables and manufacturing employment variables for the years 1990-2010, I might have to calculate manufacturing's share of total employment in each year. I find it cumbersome to have to manually define a share for each year and
2017 Aug 07
3
AliasAnalysis: may-alias subcategory
There are function which does have optimization opportunities but because of may-alias memory dependencies sometimes optimization is not effective. May be runtime checks kills the gains of optimization. For such cases aiming to do interprocedural function specialization optimization where in the clone function version no-alias assumption can be assumed and the original function version will hold
2005 Aug 15
2
queer data set
I have a dataset that is basically structureless. Its dimension varies from row to row and sep(s) are a mixture of tab and semi colon (;) and example is HEADER1 HEADER2 HEADER3 HEADER3 A1 B1 C1 X11;X12;X13 A2 B2 C2 X21;X22;X23;X24;X25 A3 B3 C3 A4 B4 C4 X41;X42;X43 A5 B5 C5 X51 etc., say. Note that a blank
2017 Jun 27
4
My experience using -DLLVM_BUILD_INSTRUMENTED_COVERAGE to generate coverage
With llc, the size of the names section can vary widely depending on the value of -DLLVM_TARGETS_TO_BUILD. Enabling coverage shouldn't increase the name section size much. I only see one place where this happens, and it's relatively cold: http://lab.llvm.org:8080/coverage/coverage-reports/llvm/coverage/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R at
1997 Nov 25
2
R-beta: Latin-1 characters in R and X
Hi! I have tried to print text with Latin-1 characters (????) from R to postscript and X11 window but when I'm using the interactive R-shell, I can't get them printed even from keyboard. Is there some configuration flags to use 7-bit or 8-bit character sets? TIA Juha -- : Juha Tikkanen -- juha.tikkanen at edita.fi -- http://www.edita.fi/ : : tel +358-9-566 0532 -- mob +358-40-557
1997 Nov 25
2
R-beta: Latin-1 characters in R and X
Hi! I have tried to print text with Latin-1 characters (????) from R to postscript and X11 window but when I'm using the interactive R-shell, I can't get them printed even from keyboard. Is there some configuration flags to use 7-bit or 8-bit character sets? TIA Juha -- : Juha Tikkanen -- juha.tikkanen at edita.fi -- http://www.edita.fi/ : : tel +358-9-566 0532 -- mob +358-40-557
2012 May 04
7
Breaking up a Row in R (transpose)
I have the following: Time A1 A1 B1 B1 C1 C2 x y x y x y 0 5 6 6 7 7 9 1 3 4 4 3 9 9 2 5 2 6 4 7 4 I want to change it to the following: 0 1 2 x y x y x y A1 5 6 3 4 5 2 B1
2017 Jun 27
2
My experience using -DLLVM_BUILD_INSTRUMENTED_COVERAGE to generate coverage
I had an old build of llc with FE instrumentation, the name section size is about 5MB. Using coverage is likely to cause the name section to be larger as there are more references to dead/unused function names. What do you see when readelf --string-dump=__llvm_prf_names llc David On Tue, Jun 27, 2017 at 2:23 PM, Xinliang David Li <davidxl at google.com> wrote: > > > On Tue,
2009 Oct 06
1
linear model with coefficient constraints
I would like to perform a regression like the one below: lm(x ~ 0 + a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3, data=data) However, the data has the property that a1+a2+a3 = A, b1+b2+b3 = B, and c1+c2+c3 = C, where A, B, and C are positive constants. So there are two extra degrees of freedom, and R handles this by producing NA for two of the coefficients. Instead, I would prefer to remove the
2013 Nov 21
1
how can I import a number of datsets in a folder in my working directory to a list in R
Hi, Suppose, if I create 15 files in my working directory. set.seed(48) lapply(1:15,function(i) {m1 <- matrix(sample(1:20,1686*2,replace=TRUE),nrow=1686,ncol=2); write.table(m1,paste0("file_",i,".txt"),row.names=FALSE,quote=FALSE)}) ?D <-dir() D1 <- D[order(as.numeric(gsub("\\D+","",D)))] D1 ?res <- t(sapply(D1,function(x) {x1<-
2011 Jul 05
3
plotting survival curves (multiple curves on single graph)
Hello. This is a follow-up to a question I posted last week. With some previous suggestions from the R-help community, I have been able to plot survival (, hazard, and density) curves using published data for Siler hazard parameters from a number of ethnographic populations. Can the function below be modified, perhaps with a "for" statement, so that multiple curves (different line