similar to: Simplify iterative programming

Displaying 20 results from an estimated 3000 matches similar to: "Simplify iterative programming"

2005 Jun 03
2
Simplify formula for iterative programming
Dear R-ians, I am looking for the simplification of a formula to improve the calculation speed of my program. Therefore I want to simplify the following formula: H = Si (Sj ( sqrt [ (Ai - Aj)?? + (Bi - Bj)?? ] ) ) where: A, B = two vectors (with numerical data) of length n sqrt = square root Si = summation over i (= 0 to n) Sj = summation over j (= 0 to n) Ai = element of A with index i Aj
2005 May 26
1
Simplify formula for heterogeneity
Dear R-ians, I'm looking for a computational simplified formula to calculate a measure for heterogeneity (let's say H ): H = sqrt [ (Si (Sj (Xi - Xj)?? ) ) /n ] where: sqrt = square root Si = summation over i (= 0 to n) Sj = summation over j (= 0 to n) Xi = element of X with index i Xj = element of X with index j I can simplify the formula to: H = sqrt [ ( 2 * n * Si (Xi) - 2 Si (Sj
2005 Dec 04
4
Construct a data.frame in a FOR-loop
Say I have a FOR-loop for computing powers (just a trivial example) for(i in 1:5) { x<-i^2 y<-i^3 } How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for each iteration Thanks, Serguei Kaniovski -- ___________________________________________________________________ ??sterreichisches Institut f??r Wirtschaftsforschung (WIFO) Name: Serguei Kaniovski
2005 Dec 06
2
how to extract row& col names from a matrix
Dear all, I like to extract row names & column names from the named matrix...... like...... a<-matrix(1:6,2) ro<-c("aa","bb") co<-c("dd","ee","ff") dimnames(a)<-list(ro,co) a > dd ee ff aa 1 3 5 bb 2 4 6 from the above matrix "a" I like to extract rownames separately like
2005 Dec 17
1
How to reverse the sequence of axis Y ??
Hello R-users! My (simple?) doubt: How to reverse the sequence of axis Y ?? the diagram below illustrate my idea... (default) | | . | . | . | 3 | 2 | 1 | 0 +---------------------------- 0 1 2 3 ... like I want... 0 | 1 | 2 | 3 | . | . | . | | +---------------------------- 0 1 2 3 ... thanks in advance klebyn
2005 Dec 06
4
R newbie...
Hello, I'm a new user... I have a function : calculate <- function(x,y) { z <- x + y } I would like to use the result (z) with another function : recalculate <- function(...) { a <- z^2 } But R says that z does not exist... How can I use z in an another function ? Thank you for your answer... -- David [[alternative HTML version deleted]]
2005 Dec 09
3
R-how to group the data
Hello R - users, This may sound simple to may people: I have a list of data as follows type value y 7 y 7 y 8 y 8 y 8 y 9 y 9 y 9 y 9 y 10 y 10 y 10 y 10 y 11 y 11 y 12 y 12 y 14 y 14 y 14 y 15 y 17 y 20 y 20 y 20 y 20 y 25
2005 Dec 06
2
Writing a list to a file !
Hi All, This may be trivial in R but I have been trying with out any success. I have a list of 100 elements each having a sub list of different length. I would like to write the list to a ASCII file. I tried with write.table(), after converting my list to a matrix. Now it looks like Robert c("90", "50", "30") John c("91", "20",
2005 Dec 15
5
How to simulate correlated data
Hello there, I would like to simulate X --Normal (20, 5) Y-- Normal (40, 10) and the correlation between X and Y is 0.6. How do I do it in R? Thank you very much Lisa Wang Msc. Princess Margaret Hospital Toronto, Ca
2005 Nov 28
6
How define global Variable?
Hello, I try to define a global variable. My example: R> a <- "old" R> test <- function () { a <- "new" } R> test() R> a # shoud be "new" This doesn't work. I would like to modify the variable "a" in a procedure. How can I do that. Thank you for helping. Sven Kn侟ppel (Germany-Berlin)
2005 Mar 17
1
Optimization of constrained linear least-squares problem
Dear R-ians, I want to perform an linear unmixing of image pixels in fractions of pure endmembers. Therefore I need to perform a constrained linear least-squares problem that looks like : min || Cx - d || ? where sum(x) = 1. I have a 3x3 matrix C, containing the values for endmembers and I have a 3x1 column vector d (for every pixel in the image). In theory my x values should all be in the
2005 Nov 12
4
matrix subset
Dear R-helpers, I apologize for this certainly simple question. I have the following R lines : > m = matrix(1:12 , 3 , 4); > m [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 2 5 8 11 [3,] 3 6 9 12 > m1 = subset(m , m[,2]>=5); > m1 [1] 2 3 5 6 8 9 11 12 but in fact I would appreciate m1 to be also a matrix, and thus would like to get :
2004 Sep 07
3
RSync + SSH tunneling through firewall
Dear RSYNCians, I'm trying to rsync my labtop pc (let's assume A-computer) with my desktop pc (let's assume C-computer) through our firewall. In between there is one computer (let's assume B-computer) that has an open port, so I theoretically could connect via a tunnel. I checked the SSH- website and internet and so on but did not find an answer that works. I tried the
2005 Oct 12
1
Rsync over SSH-tunnel A->B->C using daemon on C
Dear, I'm trying to put up a scripts to synchronize my computers (HOST_A and HOST_C). I can connect both via HOST_B to avoid the firewall. I am trying to work with the rsync daemon to avoid hanging. I tried to figure out the mailinglist + FAQ, how to do it, but it seems I misunderstand something, since all your previous help did not work for me. I get the following error when executing
2005 Oct 11
1
Rsync hangs after a while when tunneling from A->B->C
Dear Rsyncians, I'm trying to Rsync my windowsXP-pc A and C. There is a firewall in between A and C, but we have a port open on a linux-machine B to access C from A (and vica versa) via B. When I now run my Rsync scripts in cygwin: # _______________________________________________________________________________ #!/bin/bash # Command to synchronize (only update) two computers based on
2004 Nov 26
1
Multi-figure plotting
Dear R-ians, I have a question concerning plotting different plots on one figure. I have written a script to plot an image, a legend (based on different rectangles) and a timeseries plot on one figure. In my R-lagnuage it looks like this (without arguments that are not usefull for my question): #---> I first define the functions image.data<-function(...){ .... #-->Plot the
2005 Dec 03
2
How to catch value
Dear R users: I have a problem about catch the value from function. I have following two functions (part): fbolus1 <- function() {......... par<-data.frame(Parameter=c("kel","Vd"),Initial=c(0)) check(par) .....} check<-function(par) { if (par[ ,2] <= 0){ cat("\nEnter again (y/n) ?\n\n") ans<-readline() if (ans == "n" ){
2005 Nov 28
2
Robust fitting
Good evening,I am Marta Colombo, student of "Politecnico di Milano". I'm studying Local Regression Techniques such as loess, smoothing splines and kernel smoothers. Choosing "symmetric" for the argument "family" in loess function it is possible to produce a robust estimate , in function smooth.spline and ksmooth I didn't find this possibility. Well, is there a
2009 Sep 26
1
rsync finds files to sync which don't exist and then crashes
Hello, I'm running the following script for backup: SHORTHOST=`hostname | awk 'BEGIN { FS="." } { print $1 }'` cd $HOME || exit 1 rsync --ignore-errors --max-size=50m -v --delete --delete-excluded --log-file=/tmp/backup.log --exclude-from=$HOME/.rsync/exclude \ --timeout=3 -az \ $HOME atticserve:/mnt/store/backup/$SHORTHOST At some point it tries to sync the following
2010 Aug 27
1
Error: package/namespace load failed for 'IlluminaHumanMethylation27k.db'
Hello everyone, I have a problem when loading the library: IlluminaHumanMethylation27k.db I installed the package from zip (from the Bioconductor website), and also installed all the packages it asked for. It went all succesfull: "package 'IlluminaHumanMethylation27k.db' successfully unpacked and MD5 sums checked" But when I am trying to load this library I get an error: