[R] ploting missing data
Hello, I have this kind of dataframe and have to plot it. data - data.frame(sw= c(1,2,3,4,5,6,7,8,9,10,11,12,15), zehn = c(33.44,20.67,18.20,18.19,17.89,19.65,20.05,19.87,20.55,22.53,NA,NA,NA), zwanzig = c(61.42,NA,26.60,23.28,NA,24.90,24.47,24.53,26.41,28.26,NA,29.80,35.49), fuenfzig = c(162.51,66.08,49.55,43.40,NA,37.77,35.53,36.46,37.25,37.66,NA,42.29,47.80) ) The plot should have lines: lines(fuenfzig~sw, data=data) lines(zwanzig~sw, data=data) But now I have holes in my lines for the missing values (NA). How to plot the lines without the holes? The missing values should be interpolated or the left and right point directly connected. The function approx interpolates the whole dataset. Thats not my goal! Is there no plotting function to do this directly? Best Markus -- Dipl.-Tech. Math. Markus Schmidberger Ludwig-Maximilians-Universität München IBE - Institut für medizinische Informationsverarbeitung, Biometrie und Epidemiologie Marchioninistr. 15, D-81377 Muenchen URL: http://ibe.web.med.uni-muenchen.de Mail: Markus.Schmidberger [at] ibe.med.uni-muenchen.de __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] papply, reuse of data
Hello, we are doing some computations with MPI and Rmpi. Therefore papply is a very comfortable function. Is it possible to reuse calculated data on slaves? We do some calculation with papply, then we have to do some overall calculation at the master then we want to do some calculation on the slaves with the old results and some new results from the master. We do not want to send all data again from master to slave (time expensive). Is there a way to do this with papply? Thanks Markus -- Dipl.-Tech. Math. Markus Schmidberger Ludwig-Maximilians-Universität München IBE - Institut für medizinische Informationsverarbeitung, Biometrie und Epidemiologie Marchioninistr. 15, D-81377 Muenchen URL: http://ibe.web.med.uni-muenchen.de Mail: Markus.Schmidberger [at] ibe.med.uni-muenchen.de __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Problems with expresso
Hello, I want to use expresso for preprocessing the hgu133a-spikein data from affycompII. But there is an error: library(affy) path - z:/Microarray/hgu133a-spikein/rawdata celFile - list.celfiles(path=path,full.names=TRUE); affyBatch - ReadAffy(filenames=celFile[1:6]); eset1 - expresso(affyBatch,bgcorrect.method=rma,normalize.method=quantiles,summary.method=medianpolish) background correction: rma normalization: quantiles PM/MM correction : expression values: medianpolish background correcting...done. normalizing...done. Fehler in function (classes, fdef, mtable) : unable to find an inherited method for function computeExprSet, for signature AffyBatch, NULL, character sessionInfo() R version 2.5.1 (2007-06-27) i386-pc-mingw32 locale: LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252 attached base packages: [1] tools stats graphics grDevices utils datasets methods base other attached packages: hgu133atagcdf affyaffyio Biobase 1.16.0 1.14.2 1.4.1 1.14.1 Whats wrong? The function computeExprSet exists in library(affy) Thanks Markus -- Dipl.-Tech. Math. Markus Schmidberger Ludwig-Maximilians-Universität München IBE - Institut für medizinische Informationsverarbeitung, Biometrie und Epidemiologie Marchioninistr. 15, D-81377 Muenchen URL: http://ibe.web.med.uni-muenchen.de Mail: Markus.Schmidberger [at] ibe.med.uni-muenchen.de __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] simultaneous computing
Hello, which possibilities are available in R for simultaneous or parallel computing? I only could find biopara (http://cran.r-project.org/src/contrib/Descriptions/biopara.html) Are there other possibilities? Are there special groups working on simultaneous computing with R? Thanks Markus -- Dipl.-Tech. Math. Markus Schmidberger Ludwig-Maximilians-Universität München IBE - Institut für medizinische Informationsverarbeitung, Biometrie und Epidemiologie __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with C extension
Hello, thanks for help and code. We did a lot of work to speedup our function in R. We have a nested loop, vectorizing is the fastest way. But there we got a very big matrix and problems with memory. So we want to stay by loops an speedup with C. My code is similar to this. (my_c is code from Brian D. Ripley) SEXP test(SEXP a, SEXP b, SEXP in) { SEXP ans, new; int n=INTEGER(in)[0],i,j; PROTECT(ans = allocVector(REALSXP, 1)); REAL(ans)[0]=REAL(a)[0]; /*for(j = 0; i m; j++)*/ for(i = 0; i n; i++) { /* b= ... ^i *j*/ PROTECT(new = allocVector(REALSXP, i+2)); new = my_c(ans,b); PROTECT(ans = allocVector(REALSXP, i+2)); ans = new; UNPROTECT(2); } UNPROTECT(1); return ans; } We get an error by in=1300 .Call(test,1,3,as.integer(1300)); Fehler: type mismatch .Call(test,1,3,as.integer(1300)); Speicherzugriffsfehler Is there a possibility to free allocated memory? free(...) does not work. Is there a possibility to reallocate a vector? Thanks a lot Markus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Problem with C extension
Hello, I try to write an extension in C, to get a faster functions. Therefore I have to add an element (vector) to a vector. The command in R is very simple: x = c(x,a) But in C I have the problem to reallocate my vector for getting more space. Everything I tried, I get a Segmentation fault. So, how can I combine two vectors in C and give the result back to R (return(x))? Thanks Markus Schmidberger -- Dipl.-Tech. Math. Markus Schmidberger Ludwig-Maximilians-Universität München IBE - Institut für medizinische Informationsverarbeitung, Biometrie und Epidemiologie Marchioninistr. 15, D-81377 Muenchen URL: http://ibe.web.med.uni-muenchen.de Mail: Markus.Schmidberger [at] ibe.med.uni-muenchen.de Tel: +49 (089) 7095 - 4599 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.