similar to: How to change several elements of an array simultaneously?

Displaying 20 results from an estimated 20000 matches similar to: "How to change several elements of an array simultaneously?"

2000 Mar 30
1
Efficiency of local functions
Dear R-users In order to speed up the performance of my program I tried to make a function f2 (that is only called from function f1) local to f1. In that way I pass one argument less to f2, a huge matrix. (This matrix isn't changed inside f2, so - afaik - it is passed by reference and size doesn't matter.) Still I would have expected that f1 would be a little faster, but the opposit
2000 Sep 04
2
problems with R COMPILE in make
Dear R helpers I have a problem with R COMPILE. While the Makefile consisting of the lines SOURCES = imageio.c procbase.c readargs.c regSegs.c goodiesPH.c \ generalAnalysis.c edgeAggregation.c utilities.alga.c \ cs.parametrizing.c tst.so: $(SOURCES) R SHLIB -o $@ $(SOURCES) works fine, the Makefile with the target replaced by imageio.o: imageio.c R COMPILE imageio.c results in
2000 Sep 04
2
problems with R COMPILE in make
Dear R helpers I have a problem with R COMPILE. While the Makefile consisting of the lines SOURCES = imageio.c procbase.c readargs.c regSegs.c goodiesPH.c \ generalAnalysis.c edgeAggregation.c utilities.alga.c \ cs.parametrizing.c tst.so: $(SOURCES) R SHLIB -o $@ $(SOURCES) works fine, the Makefile with the target replaced by imageio.o: imageio.c R COMPILE imageio.c results in
2000 Feb 11
1
Creating efficiently a subset of a matrix
Dear R-helpers I have the following problem: given a m x n matrix A, I want to have just a m x k submatrix B, with B[i,] = A[i, offset[i] + 1:k], e.g. from > offset <- c(0, 0, 1) > a <- matrix(1:9, 3) > a [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 the submatrix b 1 4 2 5 6 9 I can do this with a for loop or with sapply > b <-
2001 Mar 26
1
Problems with R CMD COMPILE within Makefile (PR#885)
Dear R-developpers This concerns a problem I posted about half a year ago on the R-help list and to which I got some answer by Duncan Temple Lang (see below), but the basic problem still continues. Even though I managed a workaround which is sufficient for me Martin Maechler asked me to send a toy example of the problem to R-bugs. So that's what I try here. The following Makefile will not
2000 Oct 02
4
Debugging dynloaded C-code with gdb
Dear R users I have started to use gdb for debugging dynloaded C code as described in `Writing R Extensions'. Unfortunately I have run into several problems that I haven't been able to solve: - using `n': how comes that the same line of code appears up to three times (and inbetween the next line and maybe even the second next one?) - using `print' resp. `display': How
2000 Jan 13
0
problems with understanding behaviour of glm
Dear R users, I don't understand, what happens in glm in the following example (note that in S-Plus this example finishes with an almost perfect fit, but also 49 warnings): > fit.small <- glm(SKR.ein.aus ~ ., family = binomial, data = daten, maxit=100) Error in (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y, : inner loop 2; can't correct step size In addition:
1999 Jul 12
2
how to find index of maximum?
Dear R-users, Is there a simple way to find the index of the maximum of a vector? Ex. 1 3 6 2 result: 3 Thanks for any help, Peter ____________________________________________________________ Peter Holzer phone: + 41 1 632 46 34 Seminar fuer Statistik, SOL F7 fax: + 41 1 632 10 86 (Sonneggstr. 33) <holzer at stat.math.ethz.ch> ETH (Federal
1999 Feb 10
1
problems with read.table
Dear R users, I have the following problem: I have a table in ASCII-format, separated with commas. I can read it as long as no field contains a comma itself. If one does, read.table doesn't function even though that field is double-quoted. Ex.: File "test.csv": Name,Strasse,PLZ Jsaac,Gossauerstrassee 29,9100 Roth-Bernasconi,"20, ch. des Fauvettes",1212 adressen <-
1998 Sep 03
2
a nasty error
Dear R-developers The basic function seq doesn't work properly: > seq(1,6,by=3) [1] 1 4 7 Looking at the source code of seq.default I found that strange fuzz thing "+ 0.4". Taking that away the seq works fine. My question is: Why has this fuzz thing been added? If it was for some rounding problems I would suggest to replace "0.4" by something much smaller. Peter
2005 May 13
4
Encryption
Hi All, I am using rsync to backup our office server to our Internet server (RHE). As an association for doctors we are looking at providing a backup service for their practices using rsync. As it would be patient data it would need to be encrypted. I have found a few options, namely esync wurt rsyncrypto Does anyone have experience with the above and perhaps like to recommend one? On the
2000 Jan 10
5
bug in glm (PR#397)
Dear R-team As I didn't get any answer to my bug-report last week I have taken the effort and extracted a minimal data set from my data (see below) where the following bug occurs: > glm(SKR.ein.aus ~ ., family = binomial, data = bugdata, na.action = na.omit) Error in names<-.default(*tmp*, value = ynames) : names attribute must be the same length as the vector In addition: Warning
2006 Jun 23
7
malloc small pieces of memory
Hi I have a Problem with wine. I have one Program, that allogaces many small pieces with "malloc()" in the memory. "many" means over 2 Mio, "small" means "from 8 to 128 bytes" in size. Running this Program on Windows gives me ~300MB Memory Usage (according to one of the values in the Tast manager). In Linux, "top" shows me a physical Usage of
2009 Oct 22
2
Replacing multiple elements in a vector !
Hi, I have a vector with elements rs.id=c(''rs100'',''rs101'',''rs102'',''rs103'') And a dataframe ''snp.id'' 1 SNP_100 rs100 2 SNP_101 rs101 3 SNP_102 rs102 4 SNP_103 rs103 Task is to replace
2001 Jun 01
1
v matrix of svd(X) loses dimensions if nrow(X)==1 (PR#963)
Dear R-developers I'm not very sure whether this is really a bug and not a feature: > is.matrix(svd(matrix(1:12,nrow=1))$v) [1] FALSE In all other cases the $v component is a matrix. Also, the $u component always seems to be a matrix as indicated in the doc. My R-version: > version _ platform i686-pc-linux-gnu arch i686 os linux-gnu
2003 Sep 26
2
Spam-Filter @stat.math.ethz.ch: was dead for about 15 hours
As many of you have probably realized, the spam filtering at @stat.math.ethz.ch has been dead for since yesterday (09-25) ~16:50 till today ~08:30. The sudden death may have been caused by unrelated installation of some perl modules (spamassassin *is* running on perl) by our IT staff. We are very sorry for this event. On the bright side: You have been able to get a glimpse of what you are
1999 Dec 08
0
excuse the repeated mailings..
Our sys.admin fixed one important (NIS) problem and accidentally simultaneously badly broke part of sendmail's functioning. Unfortunately, this lasted ~ 40 minutes, and somehow sendmail just "thought" it had to resend these messages several times (up to 8 x) that came in during that 40 minutes' period. Accept our (math.ethz.ch)'s apologies... Martin Maechler <maechler
2000 Sep 21
1
"[.data.frame" forgets about "AsIs" (PR#665)
Short example: > str(d <- data.frame(a = I(letters[1:5]))) `data.frame': 5 obs. of 1 variable: $ a:Class 'AsIs' chr [1:5] "a" "b" "c" "d" ... > str(d[TRUE,,drop = FALSE]) `data.frame': 5 obs. of 1 variable: $ a: chr "a" "b" "c" "d" ... The real problem about this is, that as soon
2000 May 03
2
print() "bug" for arrays with 0 columns
The "bug" is that it doesn't print anything; one might argue that this is not a bug, since such an array *is* empty, but I don't buy that argument. It *does* print if #{columns} (= last dimension) > 0 : > array(NA,dim=c(2,0)) > array(NA,dim=c(2,1,0)) > array(NA,dim=c(0,2)) [,1] [,2] > array(NA,dim=c(0,2,1)) , , 1 [,1] [,2] >
2001 Oct 18
1
seq (PR#1133)
In the following special case, seq fails to give the right answer (which is 0 ) > seq(0,0,1) Error in if (dd < sqrt(.Machine$double.eps)) return(from) : missing value where logical needed For any other equal from and to , it works: > seq(1,1,1) [1] 1 The error occurs in the statement dd <- abs(del)/max(abs(to), abs(from)) of seq.default -- for obvious reasons.