[R] Error when compiling R-2.5.1 / *** [d-p-q-r-tests.Rout] Fehler 1

2015-08-01 Thread Joerg Kirschner
Hi everyone,
I am new to Linux and R - but I managed to build R-2.5.1 from source to use
it in Genepattern. Genepattern does only support R-2.5.1 which I could not
find anywhere for installation via apt-get or in the Ubuntu Software-Centre
(I am using Ubuntu 14.04 (Trusty Tahr) 32-bit)

But after doing

make check


I get

comparing 'method-dispatch.Rout' to './method-dispatch.Rout.save' ... OK
running code in 'd-p-q-r-tests.R' ...make[3]: *** [d-p-q-r-tests.Rout]
Fehler 1
make[3]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make[2]: *** [test-Specific] Fehler 2
make[2]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make[1]: *** [test-all-basics] Fehler 1
make[1]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make: *** [check] Fehler 2


but I can make install and use R for simple plots etc. afterwards - still I
am worried something is wrong, can you give some advice.

A closer look at the error gives

 ## PR#7099 : pf() with large df1 or df2:
 nu - 2^seq(25,34, 0.5)
 y - 1e9*(pf(1,1,nu) - 0.68268949)
 stopifnot(All.eq(pf(1,1,Inf), 0.68268949213708596),
+   diff(y)  0, # i.e. pf(1,1, *) is monotone increasing
+   All.eq(y [1], -5.07420372386491),
+   All.eq(y[19],  2.12300110824515))
Error: All.eq(y[1], -5.07420372386491) is not TRUE
Execution halted


As I understand so far some errors are critical some are not - can you
please give some advice on the error above? Can I still use R installed
with that error? What do I need to solve the error?

Thanks, Joerg

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Clarification on Simulation and Iteration

2015-08-01 Thread David Winsemius

On Jul 31, 2015, at 8:41 PM, Christopher Kelvin wrote:

 Thanks Dave.
 
 What I actually want is to obtain say 10, different sets of (n=50) data for 
 every 10,000 iterations I run. You will realise that the current code 
 produces one set of data (n=50). I want 10 different sets of 50 observations 
 at one run. I hope this makes sense.

I would think that either `replicate(50, ...)` or `for(i in 1:50) {...}` would 
suffice. Unless of course the phrase want 10 different sets of 50 observations 
at one run` means something different than it appears to request.


 
 Chris Guure 
 
 
 
 On Saturday, August 1, 2015 3:32 AM, David Winsemius dwinsem...@comcast.net 
 wrote:
 
 
 On Jul 31, 2015, at 6:36 PM, Christopher Kelvin via R-help wrote:
 
 Dear All,
 I am performing some simulations for a new model. I run about 10,000 
 iterations with a sample of 50 datasets and this returns one set of 50 
 simulated data. 
 
 Now, what I need to obtain is 10 sets of the 50 simulated data out of the 
 10,000 iterations and not just only 1 set.  The model is the Copas selection 
 model for publication bias in Mete-analysis. Any one who knows this model 
 has any suggestion for the improvement of my code is most welcome.
 
 Below is my code. 
 
 
 Kind regards
 
 
 Chris Guure
 University of Ghana
 
 
 
 
 install.packages(msm) 
 library(msm) 
 
 
 rho1=-0.3; tua=0.020; n=50; d=-0.2; rr=1; a=-1.3; b=0.06 
 si-rtnorm(n, mean=0, sd=1, lower=0, upper=0.2)# I used this to generate 
 standard errors for each study 
 set.seed(2)   ## I have stored the data and the output in this seed 
 
 for( i in 1:rr){ 
 
 mu-rnorm(n,d,tua^2)  # prob. of each effect estimate 
 rho-si*rho1/sqrt(tua^2 + si^2) # estimate of the correlation coefficient 
 mu0- a + b/si   # mean of the truncated normal model (Copas selection 
 model) 
 y1-rnorm(mu,si^2)# observed effects zise 
 z-rnorm(mu0,1)   # selection model 
 rho2-cor(y1, z) 
 
 select-pnorm((mu0 + rho*(y1-mu)/sqrt(tua^2 + si^2))/sqrt(1-rho^2)) 
 probselect-ifelse(selectz, y1, NA)# the prob that the study is selected 
 
 probselect 
 data-data.frame(probselect,si)# this contains both include and exclude 
 data 
 data 
 data1-data[complete.cases(data),] # Contains only the included data for 
 analysis 
 data1 
 
 
 }
 
 
 OK. The code runs without error. So  what exactly is the problem? (I have 
 no experience with the Copas selection model if in fact that is what is being 
 exemplified.)
 
 -- 
 
 David Winsemius
 Alameda, CA, USA

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] vectorized sub, gsub, grep, etc.

2015-08-01 Thread John Thaden
Adam,   
You reopened an old thread noting its age, but did you begin at its beginning?
 Subject: vectorized sub, gsub, grep, etc. Date: Oct 7, 2008
 R pattern-matching and replacement functions are
 vectorized: they can operate on vectors of targets.
 However, they can only use one pattern and replacement.
 Here is code to apply a different pattern and replacement
 for every target.  My question: can it be done better?

sub2 - function(pattern, replacement, x) {
len - length(x)
if (length(pattern) == 1) 
pattern - rep(pattern, len)
if (length(replacement) == 1) 
replacement - rep(replacement, len)
FUN - function(i, ...) {
sub(pattern[i], replacement[i], x[i], fixed = TRUE)
}
idx - 1:length(x)
sapply(idx, FUN)
}

#Example
X - c(ab, cd, ef)
patt - c(b, cd, a)
repl - c(B, CD, A)
sub2(patt, repl, X)
 
If you run that code, you'll see the correct answer is not  CD , it is

[1] aB CD ef

And the same answer is given by the shorter (but slower) code suggested later 
that day by Christos

mapply(function(p, r, x) sub(p, r, x, fixed = TRUE), p=patt, r=repl, x=X)

  b   cd    a
aB CD ef

By talking instead about simple string matching, I'm afraid you've rather 
hijacked the thread.

-John
 -John 

Adam wrote


  
  I'm not sure I understand your question. Both functions return  CD  
  because they 
 perform exact string matching. The first demonstrates how string or character 
 replacements 
 can be vectorized, while the second merely demonstrates how Rcpp can 
 accelerate this type of operation.

On Jul 30, 2015, at 21:09, John Thaden jjtha...@flash.net wrote:



| Can you show what is its solution for the original sample data? Why that 
discrepancy for you original sub2() function? 
|  From:Adam Erickson adam.michael.erick...@gmail.com
Date:Thu, Jul 30, 2015 at 6:11 pm
Subject:Re: [R] vectorized sub, gsub, grep, etc.

 Here is a Rcpp version for exact character matching (for example) written in 
C++ that is substantially faster. Hence, I think this is the way to go where 
loops may be unavoidable. However, the input vector length has to match the 
length of the pattern and replacement vectors, as your original code did. That 
can be changed though.
#include Rcpp.husing namespace Rcpp;
// [[Rcpp::export]]CharacterVector subCPP(CharacterVector pattern, 
CharacterVector replacement, CharacterVector x) {  int len = x.size();  
CharacterVector y(len);  int patlen = pattern.size();  int replen = 
replacement.size();  if (patlen != replen)    RcoutError: Pattern and 
replacement length do not match;  for(int i = 0; i  patlen; ++i) {    if 
(*(char*)x[i] == *(char*)pattern[i])      y[x[i] == pattern[i]] = 
replacement[i];  }  return y;}
   CD   

system.time(for(i in 1:5) subCPP(patt, repl, X))   user  system elapsed    
0.16    0.00    0.16 
Cheers,
Adam
On Wednesday, July 29, 2015 at 2:42:23 PM UTC-7, Adam Erickson wrote:
Further refining the vectorized (within a loop) exact string match function, I 
get times below 0.9 seconds while maintaining error checking. This is 
accomplished by removing which() and replacing 1:length() with seq_along().
sub2 - function(pattern, replacement, x) {   len    - length(x)   y      - 
character(length=len)   patlen - length(pattern)   replen - 
length(replacement)   if(patlen != replen) stop('Error: Pattern and replacement 
length do not match')   for(i in seq_along(pattern)) {     y[x==pattern[i]] - 
replacement[i]   }   return(y) }
system.time(for(i in 1:5) sub2(patt, repl, X))   user  system elapsed    
0.86    0.00    0.86 
Since the ordered vectors are perfectly aligned, might as well do an exact 
string match. Hence, I think this is not off-topic.
Cheers,
Adam
On Wednesday, July 29, 2015 at 8:15:52 AM UTC-7, Bert Gunter wrote:
There is confusion here. apply() family functions are **NOT**
vectorization -- they ARE loops (at the interpreter level), just done
in functionalized form. Please read background material (John
Chambers's books, MASS, or numerous others) to improve your
understanding and avoid posting erroneous comments.

Cheers,
Bert


Bert Gunter

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
   -- Clifford Stoll


On Tue, Jul 28, 2015 at 3:00 PM, John Thaden jjth...@flash.net wrote:
 Adam,    The method you propose gives a different result than the prior 
 methods for these example vectors
 X - c(ab, cd, ef)
 patt - c(b, cd, a)
 repl - c(B, CD, A)

 Old method 1

 mapply(function(p, r, x) sub(p, r, x, fixed = TRUE), p=patt, r=repl, x=X)
 gives
   b   cd    a
 aB CD ef

 Old method 2

 sub2 - function(pattern, replacement, x) {
     len - length(x)
     if (length(pattern) == 1)
         pattern - rep(pattern, len)
     if (length(replacement) == 1)
         replacement - rep(replacement, len)
     FUN - function(i, ...) {
         sub(pattern[i], replacement[i], x[i], fixed = TRUE)
     }

Re: [R] R and AWS

2015-08-01 Thread Tal Galili
How about this:
Setting Rstudio server using Amazon Web Services (AWS) – a step by step
(screenshots) tutorial
http://www.r-statistics.com/2015/06/setting-rstudio-server-using-amazon-web-services-aws-a-step-by-step-screenshots-tutorial/




Contact
Details:---
Contact me: tal.gal...@gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
--


On Thu, Jul 30, 2015 at 3:41 PM, My List mylistt...@gmail.com wrote:

 Hello All,

 I wanted to know if there is a quick tutorial which I could be pointed to,
 for the understanding of setting R and R studio on Amazon web services.

 Thanks in Advance,
 Harmeet

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] missing data in R

2015-08-01 Thread asena ayça özdemir
Hello Mr. FeldesmanI am a master student in biostatistic
my thesis about missing values in microarray data, but � can't create any 
values.
� want to create %10, %20,...%90 missing values for all colums in microarray 
data set .
Can you help me any code?

thank you for your attention.


Asena Ay�a �zdemirMersin University Biostatistics   
  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Clarification on Simulation and Iteration

2015-08-01 Thread Michael Dewey
I am not sure how you are doing this but there is a package on CRAN 
which implements the Copas model (metasens). I am not sure whether that 
would help in your modelling.


On 01/08/2015 02:36, Christopher Kelvin via R-help wrote:

Dear All,
I am performing some simulations for a new model. I run about 10,000 iterations 
with a sample of 50 datasets and this returns one set of 50 simulated data.

Now, what I need to obtain is 10 sets of the 50 simulated data out of the 
10,000 iterations and not just only 1 set.  The model is the Copas selection 
model for publication bias in Mete-analysis. Any one who knows this model has 
any suggestion for the improvement of my code is most welcome.

Below is my code.


Kind regards


Chris Guure
University of Ghana




install.packages(msm)
library(msm)


rho1=-0.3; tua=0.020; n=50; d=-0.2; rr=1; a=-1.3; b=0.06
si-rtnorm(n, mean=0, sd=1, lower=0, upper=0.2)# I used this to generate 
standard errors for each study
set.seed(2)   ## I have stored the data and the output in this seed

for( i in 1:rr){

mu-rnorm(n,d,tua^2)  # prob. of each effect estimate
rho-si*rho1/sqrt(tua^2 + si^2) # estimate of the correlation coefficient
mu0- a + b/si   # mean of the truncated normal model (Copas selection 
model)
y1-rnorm(mu,si^2)# observed effects zise
z-rnorm(mu0,1)   # selection model
rho2-cor(y1, z)

select-pnorm((mu0 + rho*(y1-mu)/sqrt(tua^2 + si^2))/sqrt(1-rho^2))
probselect-ifelse(selectz, y1, NA)# the prob that the study is selected

probselect
data-data.frame(probselect,si)# this contains both include and exclude data
data
data1-data[complete.cases(data),] # Contains only the included data for 
analysis
data1


}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] vectorized sub, gsub, grep, etc.

2015-08-01 Thread Adam Erickson
Hi John,

So, you think looping over the sub() function with regular expressions
disabled is somehow more nuanced? Perhaps you should have specified that
you were only interested in sub() function results. Regardless, the
original function failed to match the 'a' in 'ab,' which should have
returned 'AB' at that vector position. Hence, the 'correct' results are not
really correct. It only returned the first match. The qdap library provides
a function for this:

library(qdap)
mgsub(patt,repl,X)
[1] AB CD ef

Based on my previous pattern matching and replacement code, there is
clearly an opportunity to accelerate these function with Rcpp. I think that
is the main takeaway from all of this. Unfortunately, I cannot dedicade my
own time to this at the moment. Until then, exact string matching provides
an elegant and efficient solution. A little data preparation, which is also
quite fast, is all that is needed.

Cheers,

Adam

On Fri, Jul 31, 2015 at 11:15 PM, John Thaden jjtha...@flash.net wrote:

 Adam,

 You reopened an old thread noting its age, but did you begin at its
 beginning?

  Subject: vectorized sub, gsub, grep, etc.
  Date: Oct 7, 2008

  R pattern-matching and replacement functions are
  vectorized: they can operate on vectors of targets.
  However, they can only use one pattern and replacement.
  Here is code to apply a different pattern and replacement
  for every target.  My question: can it be done better?

 sub2 - function(pattern, replacement, x) {
 len - length(x)
 if (length(pattern) == 1)
 pattern - rep(pattern, len)
 if (length(replacement) == 1)
 replacement - rep(replacement, len)
 FUN - function(i, ...) {
 sub(pattern[i], replacement[i], x[i], fixed = TRUE)
 }
 idx - 1:length(x)
 sapply(idx, FUN)
 }

 #Example
 X - c(ab, cd, ef)
 patt - c(b, cd, a)
 repl - c(B, CD, A)
 sub2(patt, repl, X)

 If you run that code, you'll see the correct answer is not  CD , it is

 [1] aB CD ef
 And the same answer is given by the shorter (but slower) code suggested later 
 that day by Christos

 mapply(function(p, r, x) sub(p, r, x, fixed = TRUE), p=patt, r=repl, x=X)
   b   cda
 aB CD ef

 By talking instead about simple string matching, I'm afraid you've rather 
 hijacked the thread.

 -John


 -John


 Adam wrote




  I'm not sure I understand your question. Both functions return  CD
  because they
  perform exact string matching. The first demonstrates how string or
 character replacements
  can be vectorized, while the second merely demonstrates how Rcpp can
 accelerate this type of operation.


 On Jul 30, 2015, at 21:09, John Thaden jjtha...@flash.net wrote:

 Can you show what is its solution for the original sample data? Why that
 discrepancy for you original sub2() function?
 From:Adam Erickson adam.michael.erick...@gmail.com
 Date:Thu, Jul 30, 2015 at 6:11 pm
 Subject:Re: [R] vectorized sub, gsub, grep, etc.

 Here is a Rcpp version for exact character matching (for example) written
 in C++ that is substantially faster. Hence, I think this is the way to go
 where loops may be unavoidable. However, the input vector length has to
 match the length of the pattern and replacement vectors, as your original
 code did. That can be changed though.

 #include Rcpp.h
 using namespace Rcpp;

 // [[Rcpp::export]]
 CharacterVector subCPP(CharacterVector pattern, CharacterVector
 replacement, CharacterVector x) {
   int len = x.size();
   CharacterVector y(len);
   int patlen = pattern.size();
   int replen = replacement.size();
   if (patlen != replen)
 RcoutError: Pattern and replacement length do not match;
   for(int i = 0; i  patlen; ++i) {
 if (*(char*)x[i] == *(char*)pattern[i])
   y[x[i] == pattern[i]] = replacement[i];
   }
   return y;
 }

CD 

 system.time(for(i in 1:5) subCPP(patt, repl, X))
user  system elapsed
0.160.000.16

 Cheers,

 Adam

 On Wednesday, July 29, 2015 at 2:42:23 PM UTC-7, Adam Erickson wrote:

 Further refining the vectorized (within a loop) exact string match
 function, I get times below 0.9 seconds while maintaining error checking.
 This is accomplished by removing which() and replacing 1:length() with
 seq_along().

 sub2 - function(pattern, replacement, x) {
len- length(x)
y  - character(length=len)
patlen - length(pattern)
replen - length(replacement)
if(patlen != replen) stop('Error: Pattern and replacement length do not
 match')
for(i in seq_along(pattern)) {
  y[x==pattern[i]] - replacement[i]
}
return(y)
  }

 system.time(for(i in 1:5) sub2(patt, repl, X))
user  system elapsed
0.860.000.86

 Since the ordered vectors are perfectly aligned, might as well do an exact
 string match. Hence, I think this is not off-topic.

 Cheers,

 Adam

 On Wednesday, July 29, 2015 at 8:15:52 AM UTC-7, Bert Gunter wrote:

 There is confusion here. apply() 

[R] Using R to fit a curve to a dataset using a specific equation

2015-08-01 Thread Michael Eisenring
Hi there

 


I would like to use a specific equation to fit a curve to one of my data
sets (attached)

 dput(data)

structure(list(Gossypol = c(1036.331811, 4171.427741, 6039.995102,
5909.068158, 4140.242559, 4854.985845, 6982.035521, 6132.876396,
948.2418407, 3618.448997, 3130.376482, 5113.942098, 1180.171957,
1500.863038, 4576.787021, 5629.979049, 3378.151945, 3589.187889,
2508.417927, 1989.576826, 5972.926124, 2867.610671, 450.7205451, 1120.955,
3470.09352, 3575.043632, 2952.931863, 349.0864019, 1013.807628, 910.8879471,
3743.331903, 3350.203452, 592.3403778, 1517.045807, 1504.491931,
3736.144027, 2818.419785, 723.885643, 1782.864308, 1414.161257, 3723.629772,
3747.076592, 2005.919344, 4198.569251, 2228.522959, 3322.115942,
4274.324792, 720.9785449, 2874.651764, 2287.228752, 5654.858696,
1247.806111, 1247.806111, 2547.326207, 2608.716056, 1079.846532), Treatment
= structure(c(2L, 3L, 4L, 5L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 5L, 1L, 2L, 3L,
4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L,
3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L,
2L, 3L, 1L), .Label = c(C, 1c_2d, 3c_2d, 9c_2d, 1c_7d), class =
factor), Damage_cm = c(0.4955, 1.516, 4.409, 3.2665, 0.491, 2.3035, 3.51,
1.8115, 0, 0.4435, 1.573, 1.8595, 0, 0.142, 2.171, 4.023, 4.9835, 0, 0.6925,
1.989, 5.683, 3.547, 0, 0.756, 2.129, 9.437, 3.211, 0, 0.578, 2.966, 4.7245,
1.8185, 0, 1.0475, 1.62, 5.568, 9.7455, 0, 0.8295, 2.411, 7.272, 4.516, 0,
0.4035, 2.974, 8.043, 4.809, 0, 0.6965, 1.313, 5.681, 3.474, 0, 0.5895,
2.559, 0)), .Names = c(Gossypol, Treatment, Damage_cm), row.names =
c(NA, -56L), class = data.frame)

The equation is: y~yo+a*(1-b^x) Where: y =Gossypol (from my data set) x=
Damage_cm (from my data set)

The other 3 parameters are unknown: yo=Intercept, a= assymptote ans b=slope 

In the end I would like to use the equation to plot a curve (with SE
interval, I usually use ggplot2)

Furthermore, I would like to know the R2 and p value. I would also be
interested in the parameters yo , a and b

I have never done this before and would be extremely grateful if anyone
could help me? I suppose I have to use a non linear approach (glm(...)). I
found out that the mosaic package might be helpful.

thanks a lot, Mike

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Error when compiling R-2.5.1 / *** [d-p-q-r-tests.Rout] Fehler 1

2015-08-01 Thread Martin Morgan

On 07/31/2015 10:48 PM, Joerg Kirschner wrote:

Hi everyone,
I am new to Linux and R - but I managed to build R-2.5.1 from source to use
it in Genepattern. Genepattern does only support R-2.5.1 which I could not
find anywhere for installation via apt-get or in the Ubuntu Software-Centre
(I am using Ubuntu 14.04 (Trusty Tahr) 32-bit)


Are you sure you want to do this? R 2.5.1 is from 2007, which is a very long 
time ago. It seems like GenePattern is not restricted to R-2.5.1,



http://www.broadinstitute.org/cancer/software/genepattern/administrators-guide#using-different-versions-of-r

and if their default distribution uses it, then I'm not sure I'd recommend using 
GenePattern for new analysis! (Maybe you're trying to re-do a previous analysis?)


Since GenePattern modules that use R typically wrap individual CRAN or 
Bioconductor (http://bioconductor.org) packages, maybe you can take out the 
middleman ?


Martin Morgan



But after doing

make check


I get

comparing 'method-dispatch.Rout' to './method-dispatch.Rout.save' ... OK
running code in 'd-p-q-r-tests.R' ...make[3]: *** [d-p-q-r-tests.Rout]
Fehler 1
make[3]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make[2]: *** [test-Specific] Fehler 2
make[2]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make[1]: *** [test-all-basics] Fehler 1
make[1]: Verzeichnis »/home/karin/Downloads/R-2.5.1/tests« wird verlassen
make: *** [check] Fehler 2


but I can make install and use R for simple plots etc. afterwards - still I
am worried something is wrong, can you give some advice.

A closer look at the error gives


## PR#7099 : pf() with large df1 or df2:
nu - 2^seq(25,34, 0.5)
y - 1e9*(pf(1,1,nu) - 0.68268949)
stopifnot(All.eq(pf(1,1,Inf), 0.68268949213708596),

+   diff(y)  0, # i.e. pf(1,1, *) is monotone increasing
+   All.eq(y [1], -5.07420372386491),
+   All.eq(y[19],  2.12300110824515))
Error: All.eq(y[1], -5.07420372386491) is not TRUE
Execution halted


As I understand so far some errors are critical some are not - can you
please give some advice on the error above? Can I still use R installed
with that error? What do I need to solve the error?

Thanks, Joerg

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.




--
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Using R to fit a curve to a dataset using a specific equation

2015-08-01 Thread David L Carlson
I can get you started, but you should really read up on non-linear least 
squares. Calling your data frame dta (since data is a function):

plot(Gossypol~Damage_cm, dta)
# Looking at the plot, 0 is a plausible estimate for y0:
# a+y0 is the asymptote, so estimate about 4000;
# b is between 0 and 1, so estimate .5
dta.nls - nls(Gossypol~y0+a*(1-b^Damage_cm), dta, 
start=list(y0=0, a=4000, b=.5))
xval - seq(0, 10, length.out=200)
lines(xval, predict(dta.nls, data.frame(Damage_cm=xval)))
profile(dta.nls, alpha= .05)
===
Number of iterations to convergence: 3 
Achieved convergence tolerance: 1.750586e-06
attr(,summary)

Formula: Gossypol ~ y0 + a * (1 - b^Damage_cm)

Parameters:
   Estimate   Std. Error t value   Pr(|t|)
y0 1303.4529432  386.1515684 3.37550  0.0013853 ** 
a  2796.0464520  530.4140959 5.27144 2.5359e-06 ***
b 0.49391110.1809687 2.72926  0.0085950 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1394.375 on 53 degrees of freedom

Number of iterations to convergence: 3 
Achieved convergence tolerance: 1.750586e-06


David Carlson
Dept of Anthropology
Texas AM
College Station, TX  77843

From: R-help [r-help-boun...@r-project.org] on behalf of Michael Eisenring 
[michael.eisenr...@gmx.ch]
Sent: Saturday, August 01, 2015 10:17 AM
To: r-help@r-project.org
Subject: [R] Using R to fit a curve to a dataset using a specific equation

Hi there




I would like to use a specific equation to fit a curve to one of my data
sets (attached)

 dput(data)

structure(list(Gossypol = c(1036.331811, 4171.427741, 6039.995102,
5909.068158, 4140.242559, 4854.985845, 6982.035521, 6132.876396,
948.2418407, 3618.448997, 3130.376482, 5113.942098, 1180.171957,
1500.863038, 4576.787021, 5629.979049, 3378.151945, 3589.187889,
2508.417927, 1989.576826, 5972.926124, 2867.610671, 450.7205451, 1120.955,
3470.09352, 3575.043632, 2952.931863, 349.0864019, 1013.807628, 910.8879471,
3743.331903, 3350.203452, 592.3403778, 1517.045807, 1504.491931,
3736.144027, 2818.419785, 723.885643, 1782.864308, 1414.161257, 3723.629772,
3747.076592, 2005.919344, 4198.569251, 2228.522959, 3322.115942,
4274.324792, 720.9785449, 2874.651764, 2287.228752, 5654.858696,
1247.806111, 1247.806111, 2547.326207, 2608.716056, 1079.846532), Treatment
= structure(c(2L, 3L, 4L, 5L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 5L, 1L, 2L, 3L,
4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L,
3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L, 2L, 3L, 4L, 5L, 1L,
2L, 3L, 1L), .Label = c(C, 1c_2d, 3c_2d, 9c_2d, 1c_7d), class =
factor), Damage_cm = c(0.4955, 1.516, 4.409, 3.2665, 0.491, 2.3035, 3.51,
1.8115, 0, 0.4435, 1.573, 1.8595, 0, 0.142, 2.171, 4.023, 4.9835, 0, 0.6925,
1.989, 5.683, 3.547, 0, 0.756, 2.129, 9.437, 3.211, 0, 0.578, 2.966, 4.7245,
1.8185, 0, 1.0475, 1.62, 5.568, 9.7455, 0, 0.8295, 2.411, 7.272, 4.516, 0,
0.4035, 2.974, 8.043, 4.809, 0, 0.6965, 1.313, 5.681, 3.474, 0, 0.5895,
2.559, 0)), .Names = c(Gossypol, Treatment, Damage_cm), row.names =
c(NA, -56L), class = data.frame)

The equation is: y~yo+a*(1-b^x) Where: y =Gossypol (from my data set) x=
Damage_cm (from my data set)

The other 3 parameters are unknown: yo=Intercept, a= assymptote ans b=slope

In the end I would like to use the equation to plot a curve (with SE
interval, I usually use ggplot2)

Furthermore, I would like to know the R2 and p value. I would also be
interested in the parameters yo , a and b

I have never done this before and would be extremely grateful if anyone
could help me? I suppose I have to use a non linear approach (glm(...)). I
found out that the mosaic package might be helpful.

thanks a lot, Mike




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] PythonInR. Python script in R with parameters required. Download satellite images from NASA

2015-08-01 Thread Collin Lynch
Magi, is there a reason that you need to run the script via R? If your
plan is to download the data via python than then process with R, you
might consider using the Rpy2 package to link them.  This would allow
you to call the downloading code from python and then have python feed
the data to R.

Collin.

On Wed, Jul 29, 2015 at 12:29 PM, Magi Franquesa
magifranqu...@gmail.com wrote:
 Hello,

 I'm trying to execute a python script within R (3.2.1 x 64) with the
 PythonInR package. I would like to download an order of satellite images
 from Nasa using a python script (
 http://landsat.usgs.gov/documents/espa_bulk_downloader_v1.0.0.zip) but I
 have no success. I first run the pyExecfile command with the *feedparser.py*
 script and then the *download_espa_order.py* giving the required parameters
 (my mail acount and the order number), here is the code:

 setwd(C:/Python27)
 install.packages(PythonInR)
 library(PythonInR)
 pyConnect(pythonExePath=C:/Python27/python.exe)
 pyIsConnected()
 # autodetectPython(C:/Python27/python.exe)

 pyExecfile(C:/Landsat/feedparser.py)
 pyExecfile(C:/Landsat/download_espa_order.py -e magifranqu...@gmail.com
 -o magifranqu...@gmail.com-07222015-120911 -d C:/Landsat/ESPA)

 and I get this error:

 Error: unexpected string constant in
 pyExecfile(C:/Landsat/download_espa_order.py -e
 magifranqu...@gmail.com

 The code C:/Landsat/download_espa_order.py -e
 magifranqu...@gmail.com -o magifranqu...@gmail.com-07222015-120911
 -d C:/Landsat/ESPA runs ok when I use it within
 system console.

 I appreciate if someone could help me to solve this problem.

 Thank you

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] missing data in R

2015-08-01 Thread Jim Lemon
Hi Asena,
If you already have microarray data, you can simply change some of the
existing values to NA (datum Not Available). Say you have a toy 10x10
array containing absolute (initial) values:

array_values-matrix(sample(0:400,100,TRUE),nrow=10)
# create a 10% missing array
array_values_10-array_values
array_values_10[sample(1:100,10)]-NA
# next a 20% missing array
array_values_20-array_values
array_values_20[sample(1:100,20)]-NA
# and so on

This is possible because a matrix can be indexed as though it was a vector.

Jim


On Sat, Aug 1, 2015 at 10:21 PM, asena ayça özdemir
a.aycaozde...@hotmail.com wrote:
 Hello Mr. FeldesmanI am a master student in biostatistic
 my thesis about missing values in microarray data, but ý can't create any 
 values.
 ý want to create %10, %20,...%90 missing values for all colums in microarray 
 data set .
 Can you help me any code?

 thank you for your attention.


 Asena Ayça ÖzdemirMersin University Biostatistics
 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] R parallel / foreach - aggregation of results

2015-08-01 Thread jim holtman
You can always just pull the last one off the list.  When running things in
parallel, what does the last one mean?  Do you want the last from each of
the parallel threads, or just the last one on the list?  You might want to
put some flag on the data being returned so you can determine which one you
want to process.


Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

On Sat, Aug 1, 2015 at 3:19 PM, Martin Spindler martin.spind...@gmx.de
wrote:

 Dear Jim,

 Thank you very much for your response. It seems to work now, but the
 return value is not the required matrix but a list of matrices (one for
 each repition j).
 Any idea how it is possible to return only the last matrix and not all?

 Thanks and best,

 Martin



 Gesendet: Freitag, 31. Juli 2015 um 18:22 Uhr
 Von: jim holtman jholt...@gmail.com
 An: Martin Spindler martin.spind...@gmx.de
 Cc: r-help@r-project.org r-help@r-project.org
 Betreff: Re: [R] R parallel / foreach - aggregation of results

 Try this chance to actually return values:


 library(doParallel)
 Simpar3 - function(n1) {
L2distance - matrix(NA, ncol=n1, nrow=n1)
data - rnorm(n1)
diag(L2distance)=0
cl - makeCluster(4)
registerDoParallel(cl)
x - foreach(j=1:n1)  %dopar% {
  library(np)
  datj - data[j]
  for(k in j:n1) {
L2distance[j,k] - k*datj
  }
  L2distance  # return the value
}
stopCluster(cl)
return(x)
  }
  Res - Simpar3(100)


 Jim Holtman
 Data Munger Guru

 What is the problem that you are trying to solve?
 Tell me what you want to do, not how you want to do it.
 On Fri, Jul 31, 2015 at 8:39 AM, Martin Spindler martin.spind...@gmx.de
 wrote:Dear all,

 when I am running the code attached below, it seems that no results are
 returned, only the predefined NAs. What mistake do I make?
 Any comments and help is highly appreciated.

 Thanks and best,

 Martin


 Simpar3 - function(n1) {
   L2distance - matrix(NA, ncol=n1, nrow=n1)
   data - rnorm(n1)
   diag(L2distance)=0
   cl - makeCluster(4)
   registerDoParallel(cl)
   foreach(j=1:n1)  %dopar% {
 library(np)
 datj - data[j]
 for(k in j:n1) {
   L2distance[j,k] - k*datj
 }
   }
   stopCluster(cl)
   return(L2distance)
 }

 Res - Simpar3(100)

 __
 R-help@r-project.org[R-help@r-project.org] mailing list -- To UNSUBSCRIBE
 and more, see

 https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] R parallel / foreach - aggregation of results

2015-08-01 Thread Martin Spindler
Dear Jim,

Thank you very much for your response. It seems to work now, but the return 
value is not the required matrix but a list of matrices (one for each repition 
j).
Any idea how it is possible to return only the last matrix and not all?

Thanks and best,

Martin
 
 

Gesendet: Freitag, 31. Juli 2015 um 18:22 Uhr
Von: jim holtman jholt...@gmail.com
An: Martin Spindler martin.spind...@gmx.de
Cc: r-help@r-project.org r-help@r-project.org
Betreff: Re: [R] R parallel / foreach - aggregation of results

Try this chance to actually return values:
 
 
library(doParallel)
Simpar3 - function(n1) {
   L2distance - matrix(NA, ncol=n1, nrow=n1)
   data - rnorm(n1)
   diag(L2distance)=0
   cl - makeCluster(4)
   registerDoParallel(cl)
   x - foreach(j=1:n1)  %dopar% {
 library(np)
 datj - data[j]
 for(k in j:n1) {
   L2distance[j,k] - k*datj
 }
 L2distance  # return the value
   }
   stopCluster(cl)
   return(x)
 }
 Res - Simpar3(100)
 

Jim Holtman
Data Munger Guru
 
What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it. 
On Fri, Jul 31, 2015 at 8:39 AM, Martin Spindler martin.spind...@gmx.de 
wrote:Dear all,

when I am running the code attached below, it seems that no results are 
returned, only the predefined NAs. What mistake do I make?
Any comments and help is highly appreciated.

Thanks and best,

Martin


Simpar3 - function(n1) {
  L2distance - matrix(NA, ncol=n1, nrow=n1)
  data - rnorm(n1)
  diag(L2distance)=0
  cl - makeCluster(4)
  registerDoParallel(cl)
  foreach(j=1:n1)  %dopar% {
    library(np)
    datj - data[j]
    for(k in j:n1) {
      L2distance[j,k] - k*datj
    }
  }
  stopCluster(cl)
  return(L2distance)
}

Res - Simpar3(100)

__
R-help@r-project.org[R-help@r-project.org] mailing list -- To UNSUBSCRIBE and 
more, see
https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] R parallel / foreach - aggregation of results

2015-08-01 Thread William Dunlap
If you return just the row that the foreach procedure produces instead of
the entire matrix containing that row and use .combine=rbind then you will
end up with the matrix of interest.  E.g.,

Simpar3a - function (n1)
{
L2distance - matrix(NA, ncol = n1, nrow = n1)
data - rnorm(n1)
diag(L2distance) = 0
cl - makeCluster(4)
registerDoParallel(cl)
x - foreach(j = 1:n1, .combine = rbind) %dopar% {
library(np)
datj - data[j]
rowJ - numeric(n1)
for (k in j:n1) {
rowJ[k] - k * datj
}
rowJ
}
stopCluster(cl)
x
}


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Sat, Aug 1, 2015 at 12:19 PM, Martin Spindler martin.spind...@gmx.de
wrote:

 Dear Jim,

 Thank you very much for your response. It seems to work now, but the
 return value is not the required matrix but a list of matrices (one for
 each repition j).
 Any idea how it is possible to return only the last matrix and not all?

 Thanks and best,

 Martin



 Gesendet: Freitag, 31. Juli 2015 um 18:22 Uhr
 Von: jim holtman jholt...@gmail.com
 An: Martin Spindler martin.spind...@gmx.de
 Cc: r-help@r-project.org r-help@r-project.org
 Betreff: Re: [R] R parallel / foreach - aggregation of results

 Try this chance to actually return values:


 library(doParallel)
 Simpar3 - function(n1) {
L2distance - matrix(NA, ncol=n1, nrow=n1)
data - rnorm(n1)
diag(L2distance)=0
cl - makeCluster(4)
registerDoParallel(cl)
x - foreach(j=1:n1)  %dopar% {
  library(np)
  datj - data[j]
  for(k in j:n1) {
L2distance[j,k] - k*datj
  }
  L2distance  # return the value
}
stopCluster(cl)
return(x)
  }
  Res - Simpar3(100)


 Jim Holtman
 Data Munger Guru

 What is the problem that you are trying to solve?
 Tell me what you want to do, not how you want to do it.
 On Fri, Jul 31, 2015 at 8:39 AM, Martin Spindler martin.spind...@gmx.de
 wrote:Dear all,

 when I am running the code attached below, it seems that no results are
 returned, only the predefined NAs. What mistake do I make?
 Any comments and help is highly appreciated.

 Thanks and best,

 Martin


 Simpar3 - function(n1) {
   L2distance - matrix(NA, ncol=n1, nrow=n1)
   data - rnorm(n1)
   diag(L2distance)=0
   cl - makeCluster(4)
   registerDoParallel(cl)
   foreach(j=1:n1)  %dopar% {
 library(np)
 datj - data[j]
 for(k in j:n1) {
   L2distance[j,k] - k*datj
 }
   }
   stopCluster(cl)
   return(L2distance)
 }

 Res - Simpar3(100)

 __
 R-help@r-project.org[R-help@r-project.org] mailing list -- To UNSUBSCRIBE
 and more, see

 https://stat.ethz.ch/mailman/listinfo/r-help[https://stat.ethz.ch/mailman/listinfo/r-help]
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html[http://www.R-project.org/posting-guide.html]
 and provide commented, minimal, self-contained, reproducible code.

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.