[R] Control over character height, width, skew etc.?

2013-11-03 Thread Iakub Henschen
I would like to add characters to R plots but need separate control over
height, width, skew, rotation etc. These parameters result from a
statistical computation within R. Also I need to be able to control stroke
and fill parameters independently. Finally, I need more than just ASCII
characters, but symbols and possibly Chinese/Japanese. What I've found so
far points to a solution where I send the character and scale information
to an external script that produces what I need in Postscript, then import
via the grImport package. I assume there is a more direct way via editing R
sources, such as inserting a transformation into text(), but that's
probably not a good idea in the long run. Or is there a better strategy?

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Failed to install kernlab package

2013-11-03 Thread Lizkitty
Hi everyone, 

I am trying to install kernlab package, but failed many times by now on
CentOS 6 operating system.

Here is the error message:

trying URL 'http://ftp.ussg.iu.edu/CRAN/src/contrib/kernlab_0.9-18.tar.gz'
Content type 'application/x-gzip' length 1069148 bytes (1.0 Mb)
opened URL
==
downloaded 1.0 Mb

* installing *source* package kernlab ...
** package kernlab successfully unpacked and MD5 sums checked
** libs
g++ 
.
.
.
make: *** [brweight.o] Error 1
ERROR: compilation failed for package kernlab
* removing ~/n/home09/wang/R/x86_64-unknown-linux-gnu-library/3.0/kernlab

The downloaded source packages are in
~/scratch/tmp/RtmphA5FF9/downloaded_packages
Warning message:
In install.packages(kernlab) :
  installation of package kernlab had non-zero exit status


I found out online that many others also failed installing kernlab, but no
explicit solutions for this problem. 
What I have tried so far are:
1) change cran mirrors
2) using command line directly: R CMD INSTALL kernlab_0.9-18.tar.gz, after
downloading the package
3) reset working directory
Unfortunately, none of these solved my problem...

Any suggestions are highly appreciated!





--
View this message in context: 
http://r.789695.n4.nabble.com/Failed-to-install-kernlab-package-tp4679626.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Package(s) for making waffle plot-like figures?

2013-11-03 Thread Zhao Jin
Thank you very much for your codes and your descriptions. I ran them with
my data, and they worked well!

I am so happy to learn that your R codes and package could help me make
these plots: I was baffled by this task and have been searching for
solutions. I thought I was missing some arguments for ggplot, but couldn't
figure out which ones. Then I almost went to python and html for solving
it, although I believe that there must be a way that R can do it. It would
be great if you could include it as a function for your plotrix package, as
I have seen other people asking around for it, too.

Best regards,
Zhao


2013/11/2 Jim Lemon j...@bitwrit.com.au

 On 11/02/2013 10:35 AM, Zhao Jin wrote:

 Dear all,

 I am trying to make a series of waffle plot-like figures for my data to
 visualize the ratios of amino acid residues at each position. For each one
 of 37 positions, there may be one to four different amino acid residues.
 So
 the data consist of the positions, what residues are there, and the ratios
 of residues. The ratios of residues at a position add up to 100, or close
 to 100 (more on this soon)*. I am hoping to make a *square* waffle

 plot-like figure for each position, and fill the 10 X 10 grids with colors
 representing each amino acid residue and areas for grids of a certain
 color
 corresponding to the ratio of that residue. Then I could line up all the
 plots in one row from position 1 to position 37.
 *: if the sum of the ratios is less than 100 at a position, that's because
 of an unknown residue which I did not include in the table.

 I am attaching the dput output for my data here:
 structure(list(position = c(1L, 2L, 3L, 4L, 4L, 5L, 6L, 7L, 7L,
 8L, 9L, 9L, 9L, 10L, 10L, 11L, 11L, 12L, 12L, 13L, 13L, 14L,
 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 22L, 23L, 24L, 25L, 26L,
 26L, 27L, 28L, 29L, 29L, 30L, 31L, 32L, 33L, 34L, 34L, 35L, 35L,
 36L, 36L, 36L, 37L, 37L), residue = structure(c(9L, 4L, 18L,
 7L, 9L, 7L, 12L, 3L, 4L, 1L, 7L, 9L, 12L, 1L, 4L, 4L, 13L, 5L,
 14L, 2L, 18L, 3L, 16L, 9L, 17L, 15L, 7L, 5L, 5L, 7L, 17L, 13L,
 15L, 11L, 6L, 13L, 16L, 14L, 10L, 13L, 17L, 1L, 1L, 17L, 1L,
 12L, 1L, 5L, 3L, 6L, 8L, 7L, 9L), .Label = c(A, C, D, E,
 G, H, I, K, L, M, N, P, Q, R, S, T, V,
 Y), class = factor), ratio = c(99L, 100L, 100L, 1L, 99L,
 100L, 100L, 1L, 98L, 100L, 10L, 87L, 3L, 79L, 9L, 12L, 84L, 99L,
 1L, 83L, 13L, 100L, 100L, 100L, 100L, 99L, 100L, 100L, 100L,
 98L, 2L, 100L, 100L, 100L, 2L, 98L, 100L, 100L, 1L, 99L, 100L,
 100L, 98L, 100L, 95L, 5L, 98L, 2L, 3L, 95L, 1L, 1L, 98L)), .Names =
 c(position,
 residue, ratio), class = data.frame, row.names = c(1,
 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15,
 17, 18, 19, 20, 23, 25, 27, 28, 29, 30, 31,
 32, 33, 34, 36, 37, 38, 39, 40, 42, 43, 44,
 45, 46, 47, 48, 50, 51, 52, 53, 54, 56, 57,
 58, 59, 60, 61, 62, 63, 64, 65))

 Inspired by a statexchange post, I am using these scripts to make the
 plots
 :
 library(ggplot2)
 col4=c('#E66101','#FDB863','#B2ABD2','#5E3C99')
 dflist=list()
 for (i in 1:37){
 residue_num=length(which(df$position==i))
 dflist[[i]]=df[df$position==i,2:3]
 waffle=expand.grid(y=1:residue_num,x=seq_len(ceiling(
 sum(dflist[[i]]$ratio)/residue_num)))
 residuevec=rep(dflist[[i]]$residue,dflist[[i]]$ratio)
 waffle$residue=c(as.vector(residuevec),rep(NA,nrow(
 waffle)-length(residuevec)))
 png(paste('plot',i,'.png',sep=''))
 print(ggplot(waffle, aes(x = x, y = y, fill = residue)) + geom_tile(color
 =
 white) + scale_fill_manual(residue,values = col4) + coord_equal() +
 theme(panel.grid.minor=element_blank(),panel.grid.major=element_blank())
 + theme(axis.ticks=element_blank()) +
 theme(axis.text.x=element_blank(),axis.text.y=element_blank()) +
 theme(axis.title.x=element_blank(),axis.title.y=element_blank())
 )
 dev.off()}

 With my scripts, I could make a waffle plot, but not a *square* 10 X 10

 waffle plot. Also, the grid size differs for positions with different
 numbers of residues. I am suspecting that I didn't use coord_equal()
 correctly.

 So I wonder how I can make the plots like I described above in ggplot2 or
 with some other packages. Also, is there a way to assign a color to
 different residues, say, purple for alanine, blue for glycine, etc, and
 incorporate that information in the for loop?

  Hi Zhao,
 By beginning with a 10x10 matrix of NA values and then replacing some of
 them with a color, I think you can do what you want. First you need a
 function to fill one corner of your matrix with values, leaving the rest
 uncolored (i.e. NA):

 fill.corner-function(x,nrow,ncol) {
  xlen-length(x)
  if(nrow*ncol  xlen) {
   newmat-matrix(NA,nrow=nrow,ncol=ncol)
   xside-1
   while(xside*xside  xlen) xside-xside+1
   row=1
   col=1
   for(xindex in 1:xlen) {
newmat[row,col]-x[xindex]
if(row == xside) {
 col-col+1
 row-1
}
else row-row+1
   }
   return(newmat)
  }
  cat(Too many values in x for,xrow,by,xcol,\n)
 }

 Then you have to massage your data frame into 37 smaller data frames,
 create 

[R] Hierarchical Cluster Analysis with large dataset

2013-11-03 Thread Petar Milin
Hello!
Can anyone give me advice on running Hierarchical Cluster Analysis on large
datasets? For example, 8x1. Calculating distances on such a
dataframe seems impossible even on very powerful computer.

Also, any other advice that would lead to reduction of dimensionality,
i.e., cluster/group variables would be more than welcomed.

Many thanks,
PM

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Failed to install kernlab package

2013-11-03 Thread Prof Brian Ripley

On 03/11/2013 02:54, Lizkitty wrote:

Hi everyone,

I am trying to install kernlab package, but failed many times by now on
CentOS 6 operating system.

Here is the error message:

trying URL 'http://ftp.ussg.iu.edu/CRAN/src/contrib/kernlab_0.9-18.tar.gz'
Content type 'application/x-gzip' length 1069148 bytes (1.0 Mb)
opened URL
==
downloaded 1.0 Mb

* installing *source* package kernlab ...
** package kernlab successfully unpacked and MD5 sums checked
** libs
g++
.
.
.


And the actual error message was here.

Please read the posting guide.  As this is a C error, you should be 
posting to  R-devel, and we cannot help you without the actual error 
message.



make: *** [brweight.o] Error 1
ERROR: compilation failed for package kernlab
* removing ~/n/home09/wang/R/x86_64-unknown-linux-gnu-library/3.0/kernlab

The downloaded source packages are in
 ~/scratch/tmp/RtmphA5FF9/downloaded_packages
Warning message:
In install.packages(kernlab) :
   installation of package kernlab had non-zero exit status


I found out online that many others also failed installing kernlab, but no
explicit solutions for this problem.


Really?  Who are these 'many others'?  The CRAN check page 
http://cran.r-project.org/web/checks/check_results_kernlab.html shows 
success on several platforms.




What I have tried so far are:
1) change cran mirrors
2) using command line directly: R CMD INSTALL kernlab_0.9-18.tar.gz, after
downloading the package
3) reset working directory
Unfortunately, none of these solved my problem...

Any suggestions are highly appreciated!





--
View this message in context: 
http://r.789695.n4.nabble.com/Failed-to-install-kernlab-package-tp4679626.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org 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] computation of hessian matrix

2013-11-03 Thread IZHAK shabsogh





On Sunday, November 3, 2013 3:17 PM, IZHAK shabsogh ishaqb...@yahoo.com wrote:
 
Hi,
another problem after getting the above hessian matrix i am suppose to use it 
and fine the sum of the product
of the hessian and the residuals, for the hessian is generated from the above 
while the residual is also obtain from
the code below :


 freg-function(){
+   reg- lm(y ~ x1 + x2 , data=x)
+   fit-nls(y ~ x1 / (1+ b1*x2^b2),data = xx, start = 
+   list(b1= 0.0215,b2=-0.1675 ))
+   residuals-data.frame(residuals(fit))
+   rresult-list(reg,fit,residuals)
+   print(rresult)
+ }
  freg()



for me to do that i try this code to get the sum of the product of the 
residuals and the hessian as
 residual = e, hessian =h. 
Matrix = e1*h1 +
 e2*h2+ e3*h3 + . . .e29h29


he - function(){
  for(i in 1:29){
          tkp-hessianList[[i]]
          tkp1-residuals[i]
          kpo-tkp*tkp1
          print(kpo)
    }
}  
 he()

my problem is on how to evaluate the above that is (Matrix = e1*h1 + e2*h2+ 
e3*h3 + . . .e29h29) 
kindly guide me on how to go about this problem also if there is any mistake in 
the flow of my code 
 need your correction please because i am a beginner


thanks your understanding






On Saturday, November 2, 2013 1:24 AM, Dennis Murphy djmu...@gmail.com wrote:
 
Hi:

In R, it is common to write a function to do the hard work for a
generic single instance and then use an 'apply family' function to map
the function to a set of instances. In this case, the mapply()
function fits your problem since you have multiple input vectors of
the same length.

# Function to generate a 2 x 2 matrix taking x1 and x2 as
# scalar input arguments, using your given values of b1 and b2
# as default values. They can be changed when the function
# is called.
hessianGen - function(x1, x2, b1 = 4.286, b2 = 1.362)
{
   gh-matrix(0,2,2)
   exp0-(1+b1*x2^b2)
   exp1-x1*x2^b2*log(x2)
   exp3-x1*b1*x2^b2*(log(x2))^2
   gh[1,1]-2*x2^(2*b2)*exp0/exp0^4
   gh[1,2]--(exp0^2*exp1 - 2*b1*x2^b2*exp0*exp1)/exp0^4
   gh[2,1]--(exp3*exp0^2-2*exp0*b1^2*x2^b2*log(x2)*exp1)/exp0^4
   gh[2,2]--(exp1*exp0^2-2*exp0*x2^b2*b1*exp1)/exp0^4
   gh
}

# Use mapply to recursively run hessianGen() on the corresponding
# elements of x1 and x2. The argument SIMPLIFY = FALSE is
# required to ensure that the matrix output of the function is kept.
# Returns a list of matrices.
hessianList - mapply(hessianGen, x1, x2, SIMPLIFY = FALSE)

 length(hessianList)
[1] 29
 hessianList[[1]]
             [,1]      [,2]
[1,]  0.004186016 0.2470583
[2,] -2.104838360 0.2470583
 hessianList[[2]]
            [,1]       [,2]
[1,] 0.006006215 0.05384947
[2,] 0.211386483 0.05384947

Your definition of gh[1, 2] and gh[2, 2] are the same. If that's the
intent, you could save some computation in the function and just write
gh[2, 2] - gh[1, 2]; if not, you might want to look more closely at
your definitions.

Dennis


On Fri, Nov 1, 2013 at 3:06 AM, IZHAK shabsogh ishaqb...@yahoo.com wrote:
 below is a code to compute hessian matrix , which i need to generate 29 
 number of different matrices for example first element in x1 and x2 is use to 
 generate let say matrix (M1) and second element in x1 and x2 give matrix (M2) 
 upto  matrix (M29) corresponding to the total number of observations and b1 
 and b2 are constant.
 can some one guide me or help to implement this please. I did not understand 
 how to construct the loop which i think it should be

 about 3 dfferent loops
 example i = 1 to 29 number of matrices
                 j1=1 t0 2 row of matirx
                 j2= 1 to 2 ncol of matrix


 x1-c(5.548,4.896,1.964,3.586,3.824,3.111,3.607,3.557,2.989,18.053,3.773,1.253,2.094,2.726,1.758,5.011,2.455,0.913,0.890,2.468,4.168,4.810,34.319,1.531,1.481,2.239,4.204,3.463,1.727)
 y-c(2.590,3.770,1.270,1.445,3.290,0.930,1.600,1.250,3.450,1.096,1.745,1.060,0.890,2.755,1.515,4.770,2.220,0.590,0.530,1.910,4.010,1.745,1.965,2.555,0.770,0.720,1.730,2.860,0.760)
 x2-c(0.137,2.499,0.419,1.699,0.605,0.677,0.159,1.699,0.340,2.899,0.082,0.425,0.444,0.225,0.241,0.099,0.644,0.266,0.351,0.027,0.030,3.400,1.499,0.351,0.082,0.518,0.471,0.036,0.721)
 b1-4.286b2-1.362

 n-29
 for(i in 1:n){
     gh-matrix(0,2,2)

 exp0-(1+b1*x2^b2)
 exp1-x1*x2^b2*log(x2)
 exp3-x1*b1*x2^b2*(log(x2))^2
 gh[1,1]-2*x2^(2*b2)*exp0/exp0^4
 gh[1,2]--(exp0^2*exp1 - 2*b1*x2^b2*exp0*exp1)/exp0^4
 gh[2,1]--(exp3*exp0^2-2*exp0*b1^2*x2^b2*log(x2)*exp1)/exp0^4
 gh[2,2]--(exp1*exp0^2-2*exp0*x2^b2*b1*exp1)/exp0^4
 }
         [[alternative HTML version deleted]]


 __
 R-help@r-project.org 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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the 

[R] Comparison of two weibull distributions

2013-11-03 Thread kmmoon100
Hello,

How can I do a test of two weibull distributions?
I have two weibull distribution sets from two wind datasets in order to
check whether they are same.
I thought 2 sample t-test would be applicable but I couldn't find any ways
to do that on the Internet.
Does anyone know what type of test is applicable to my purpose? and what R
function can you recommend?
Plus, if it turned out that there is a difference between the two datasets,
can I just fit a linear line between the datasets? 

Kind Regards,

Kangmin.



--
View this message in context: 
http://r.789695.n4.nabble.com/Comparison-of-two-weibull-distributions-tp4679632.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Hierarchical Cluster Analysis with large dataset

2013-11-03 Thread Ranjan Maitra
On Sun, 3 Nov 2013 10:42:06 +0100 Petar Milin
petar.mi...@uni-tuebingen.de wrote:

 Hello!
 Can anyone give me advice on running Hierarchical Cluster Analysis on large
 datasets? For example, 8x1. Calculating distances on such a
 dataframe seems impossible even on very powerful computer.
 
 Also, any other advice that would lead to reduction of dimensionality,
 i.e., cluster/group variables would be more than welcomed.

You have two different issues here: size of dataset (number of
observations which prevents storage in memory of the distance matrix)
and number of variables (which does not, but probably hinders reading
in the dataset.

You need to provide more information here: why do you need/want to do
hierarchical clustering, if so, do you only need to use R. What
hardware you have at your disposal, etc.

Depending on your answers to the above, this may well be a research
problem in its own right.

HTH!

Best wishes,
Ranjan

 __
 R-help@r-project.org 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.
 


-- 
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. Please respond to the mailing list if appropriate.
For those needing to send personal or professional e-mail, please use
appropriate addresses.


FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks  orcas on your 
desktop!

__
R-help@r-project.org 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] Hierarchical Cluster Analysis with large dataset

2013-11-03 Thread Bert Gunter
(Offlist, since this is just a personal comment).

I cannot help you -- but it sounds like the sort of thing that you
should look for on the BioconductoR list.

But I wonder how you could possibly interpret the results even if you
could get them. I would think they would be more noise than signal,
and making sense of such a mess would be hopeless. Maybe you need to
rethink your approach.

No need to respond to me, of course.

Cheers,
Bert

On Sun, Nov 3, 2013 at 1:42 AM, Petar Milin
petar.mi...@uni-tuebingen.de wrote:
 Hello!
 Can anyone give me advice on running Hierarchical Cluster Analysis on large
 datasets? For example, 8x1. Calculating distances on such a
 dataframe seems impossible even on very powerful computer.

 Also, any other advice that would lead to reduction of dimensionality,
 i.e., cluster/group variables would be more than welcomed.

 Many thanks,
 PM

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

(650) 467-7374

__
R-help@r-project.org 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] Comparison of two weibull distributions

2013-11-03 Thread Ben Bolker
kmmoon100 k.moon at student.unimelb.edu.au writes:

 
 Hello,
 
 How can I do a test of two weibull distributions?
 I have two weibull distribution sets from two wind datasets in order to
 check whether they are same.
 I thought 2 sample t-test would be applicable but I couldn't find any ways
 to do that on the Internet.
 Does anyone know what type of test is applicable to my purpose? and what R
 function can you recommend?
 Plus, if it turned out that there is a difference between the two datasets,
 can I just fit a linear line between the datasets? 
 
 Kind Regards,
 
 Kangmin.

  (1) Fit a single model to the combined (pooled data) (e.g. with
MASS::fitdistr()); (2) fit separate models to the individual data
sets; (3) compare the log-likelihood of the pooled model to the
sum of the log-likelihoods of the separate models.  According to
the likelihood ratio test, the p-value of the differences is:

  pchisq(2*(logLik_sum-logLik_pooled),df=2,lower.tail=FALSE)

(2 df because the separate models have a total of 4 parameters,
2 greater than the pooled model)

__
R-help@r-project.org 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] (no subject)

2013-11-03 Thread GIZACHEW TAREKEGN GETAHUN
Hi,
I failed to install 'glht' and 'lsmip packages'. I am using R version 3.0.2

BR,
Gizachew
[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Rtools for writing packages

2013-11-03 Thread Adam Clark
I apologize for what is likely a stupid question - I HAVE looked through
Writing R Extensions and HAVE gone through existing help requests, but
have not yet found an answer. I'm sorry if I've missed something obvious.

I am planning on building a package in the near future. I have a number of
C programs that I have written to interface with R (compiled using the R
SHLIB, run using the .C convention).

I now run a Linux system, but seem to remember that for Mac and Windows
implementations of R, Rtools is required separately in order to run
compiled C code that interfaces directly with R.

I am wondering whether any packages that I write using such C code will
require end users of PC and Mac to have Rtools installed, or whether there
is a way to build the package such that this is not the case.

I ask this because I would like the package to be relatively painlessly
portable, and know many users who have had trouble installing Rtools on
their Mac or PC.

Many thanks,
Adam

-- 
Adam Clark
University of Minnesota, EEB
100 Ecology Building
1987 Upper Buford Circle
St. Paul, MN 55108
(857)-544-6782

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Rtools for writing packages

2013-11-03 Thread Duncan Murdoch

On 13-11-03 2:40 PM, Adam Clark wrote:

I apologize for what is likely a stupid question - I HAVE looked through
Writing R Extensions and HAVE gone through existing help requests, but
have not yet found an answer. I'm sorry if I've missed something obvious.

I am planning on building a package in the near future. I have a number of
C programs that I have written to interface with R (compiled using the R
SHLIB, run using the .C convention).

I now run a Linux system, but seem to remember that for Mac and Windows
implementations of R, Rtools is required separately in order to run
compiled C code that interfaces directly with R.

I am wondering whether any packages that I write using such C code will
require end users of PC and Mac to have Rtools installed, or whether there
is a way to build the package such that this is not the case.

I ask this because I would like the package to be relatively painlessly
portable, and know many users who have had trouble installing Rtools on
their Mac or PC.


Windows users require Rtools to develop packages containing C code, but 
not to run them, as long as someone is producing a binary package for 
them.  If you send your package to CRAN that will happen automatically. 
 If you don't, you'll need to find some other way to produce the 
binaries (e.g. WinBuilder).


Mac users are similar, but don't use Rtools, they use a different 
collection of tools.


So you should be fine:  if you write portable C and send your package to 
CRAN, you don't need to worry.


Duncan Murdoch

__
R-help@r-project.org 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] (no subject)

2013-11-03 Thread Jeff Newmiller
Kind of difficult to help you if you don't help us do so. Please read the 
Posting Guide for this mailing list and follow the recommendations there.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

GIZACHEW TAREKEGN GETAHUN giztar2...@yahoo.com wrote:
Hi,
I failed to install 'glht' and 'lsmip packages'. I am using R version
3.0.2

BR,
Gizachew
   [[alternative HTML version deleted]]

__
R-help@r-project.org 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-help@r-project.org 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] Failed to install kernlab package

2013-11-03 Thread Lizkitty
Thanks for the suggestion, I will re-post it on R-devel.

By others, what I mean is that when I searched for solutions, I found other
people also posted questions with their problems with kernlab installation
on linux platform.  I have no problem with kernlab installation on windows
platform though.

Anyway, I will post it again on R-devel, with more details. Thanks all the
same!



--
View this message in context: 
http://r.789695.n4.nabble.com/Failed-to-install-kernlab-package-tp4679626p4679651.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Hierarchical Cluster Analysis with large dataset

2013-11-03 Thread Sarah Goslee
Hi,

I think your dataset is too large to be interpretable, but in general
you should check out the cluster package, specifically clara(), which
is intended for use with large data.

Sarah

On Sun, Nov 3, 2013 at 4:42 AM, Petar Milin
petar.mi...@uni-tuebingen.de wrote:
 Hello!
 Can anyone give me advice on running Hierarchical Cluster Analysis on large
 datasets? For example, 8x1. Calculating distances on such a
 dataframe seems impossible even on very powerful computer.

 Also, any other advice that would lead to reduction of dimensionality,
 i.e., cluster/group variables would be more than welcomed.

 Many thanks,
 PM

-- 
Sarah Goslee
http://www.functionaldiversity.org

__
R-help@r-project.org 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] Hierarchical Cluster Analysis with large dataset

2013-11-03 Thread Thomas Lumley
On Sun, Nov 3, 2013 at 10:42 PM, Petar Milin
petar.mi...@uni-tuebingen.dewrote:

 Hello!
 Can anyone give me advice on running Hierarchical Cluster Analysis on large
 datasets? For example, 8x1. Calculating distances on such a
 dataframe seems impossible even on very powerful computer.

 Also, any other advice that would lead to reduction of dimensionality,
 i.e., cluster/group variables would be more than welcomed.



It's going to be slow: does it *have* to be hierarchical?

There are algorithms that don't require the whole distance matrix at once,
but when the number of dimensions is not small I don't think there are any
algorithms taking less than n^2 time even on average.

In applications where I have seen large-n clustering it has mostly been
variants of k-means, which take kn time and space, not n^2.

Look at the Bioconductor flow-cytometry packages.

  -thomas

-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Replace element with pattern

2013-11-03 Thread mohan . radhakrishnan
Hi,

How do we extract the numbers into an array or data frame assuming the 
rows of text is in a data frame ?

 head(a)
 Col1
1 Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|
2 Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|
 

The working pattern is this [0-9]*(,|\|)

I tried

gsub([0-9]*(,|/|),,a$Col1)

 grep([0-9]*(,|/|),a$Col1,value=TRUE)
[1] Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|
[2] Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|


 str_extract(a$Col1,[0-9]*(,|/|))
[1]  


Thanks



From:   arun smartpink...@yahoo.com
To: R help r-help@r-project.org
Cc: mohan.radhakrish...@polarisft.com 
mohan.radhakrish...@polarisft.com
Date:   11/01/2013 06:40 PM
Subject:Re: [R] Replace element with pattern





Hi,

Try this:

Lines1 - readLines(textConnection(Peak Usage: init:2359296, 
used:15859328, committed:15892480,max:50331648Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|---|
Peak Usage: init:2359296, used:15859328, 
committed:15892480,max:50331648Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|---|))

data.frame(Col1=as.matrix(gsub((.*?[/|]),\\1,Lines1))) #Assuming that 
you want to read it from Peak Usage to the first |:

#If it is from Current Usage to |

data.frame(Col1=as.matrix(gsub(^.*(Current.*?[/|]).*,\\1,Lines1)))


A.K.


On Friday, November 1, 2013 4:11 AM, mohan.radhakrish...@polarisft.com 
mohan.radhakrish...@polarisft.com wrote:
Hi,
 I have a data frame with one column and several rows of the form.

Peak Usage: init:2359296, used:15859328, committed:15892480, 
max:50331648Current Usage : init:2359296, used:15857920, 
committed:15892480, max:50331648|---|

I tested the regex 

Current.*?[\|]

in an online tester which greedily matches upto the first 'pipe' character

Current Usage : init:2359296, used:15857920, committed:15892480, 
max:50331648|

This is what I want.

I tried to replace the entire rows using 

apply( y, 1, function(x) gsub(x,Current.*?[/|],x)) which didn't work.

How is this done ? I also want to recursively apply some more patterns one 

by one on the rows till I reduce it to exactly what I want. Is there a way 

to do this without loops ?

Thanks,
Mohan


This e-Mail may contain proprietary and confidential information and is 
sent for the intended recipient(s) only.  If by an addressing or 
transmission error this mail has been misdirected to you, you are 
requested to delete this mail immediately. You are also hereby notified 
that any use, any form of reproduction, dissemination, copying, 
disclosure, modification, distribution and/or publication of this e-mail 
message, contents or its attachment other than by its intended recipient/s 
is strictly prohibited.

Visit us at http://www.polarisFT.com

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.





This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only.  If by an addressing or transmission error 
this mail has been misdirected to you, you are requested to delete this mail 
immediately. You are also hereby notified that any use, any form of 
reproduction, dissemination, copying, disclosure, modification, distribution 
and/or publication of this e-mail message, contents or its attachment other 
than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polarisFT.com

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Replace element with pattern

2013-11-03 Thread mohan . radhakrishnan
Please ignore. This works.

str_extract_all(a$Col1,[0-9]+(,|/|))

Mohan



From:   mohan.radhakrish...@polarisft.com
To: arun smartpink...@yahoo.com
Cc: R help r-help@r-project.org
Date:   11/04/2013 12:22 PM
Subject:Re: [R] Replace element with pattern
Sent by:r-help-boun...@r-project.org



Hi,

How do we extract the numbers into an array or data frame assuming the 

rows of text is in a data frame ?

 head(a)
 Col1
1 Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|
2 Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|
 

The working pattern is this [0-9]*(,|\|)

I tried

gsub([0-9]*(,|/|),,a$Col1)

 grep([0-9]*(,|/|),a$Col1,value=TRUE)
[1] Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|
[2] Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|


 str_extract(a$Col1,[0-9]*(,|/|))
[1]  


Thanks



From:   arun smartpink...@yahoo.com
To: R help r-help@r-project.org
Cc: mohan.radhakrish...@polarisft.com 
mohan.radhakrish...@polarisft.com
Date:   11/01/2013 06:40 PM
Subject:Re: [R] Replace element with pattern





Hi,

Try this:

Lines1 - readLines(textConnection(Peak Usage: init:2359296, 
used:15859328, committed:15892480,max:50331648Current Usage : init:2359296 

used:15857920,committed:15892480,max:50331648|---|
Peak Usage: init:2359296, used:15859328, 
committed:15892480,max:50331648Current Usage : init:2359296 
used:15857920,committed:15892480,max:50331648|---|))

data.frame(Col1=as.matrix(gsub((.*?[/|]),\\1,Lines1))) #Assuming that 
you want to read it from Peak Usage to the first |:

#If it is from Current Usage to |

data.frame(Col1=as.matrix(gsub(^.*(Current.*?[/|]).*,\\1,Lines1)))


A.K.


On Friday, November 1, 2013 4:11 AM, mohan.radhakrish...@polarisft.com 
mohan.radhakrish...@polarisft.com wrote:
Hi,
 I have a data frame with one column and several rows of the form.

Peak Usage: init:2359296, used:15859328, committed:15892480, 
max:50331648Current Usage : init:2359296, used:15857920, 
committed:15892480, max:50331648|---|

I tested the regex 

Current.*?[\|]

in an online tester which greedily matches upto the first 'pipe' character

Current Usage : init:2359296, used:15857920, committed:15892480, 
max:50331648|

This is what I want.

I tried to replace the entire rows using 

apply( y, 1, function(x) gsub(x,Current.*?[/|],x)) which didn't work.

How is this done ? I also want to recursively apply some more patterns one 


by one on the rows till I reduce it to exactly what I want. Is there a way 


to do this without loops ?

Thanks,
Mohan


This e-Mail may contain proprietary and confidential information and is 
sent for the intended recipient(s) only.  If by an addressing or 
transmission error this mail has been misdirected to you, you are 
requested to delete this mail immediately. You are also hereby notified 
that any use, any form of reproduction, dissemination, copying, 
disclosure, modification, distribution and/or publication of this e-mail 
message, contents or its attachment other than by its intended recipient/s 

is strictly prohibited.

Visit us at http://www.polarisFT.com

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.





This e-Mail may contain proprietary and confidential information and is 
sent for the intended recipient(s) only.  If by an addressing or 
transmission error this mail has been misdirected to you, you are 
requested to delete this mail immediately. You are also hereby notified 
that any use, any form of reproduction, dissemination, copying, 
disclosure, modification, distribution and/or publication of this e-mail 
message, contents or its attachment other than by its intended recipient/s 
is strictly prohibited.

Visit us at http://www.polarisFT.com

 [[alternative HTML version deleted]]

__
R-help@r-project.org 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.




This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only.  If by an addressing or transmission error 
this mail has been misdirected to you, you are requested to delete this mail 
immediately. You are also hereby notified that any use, any form of 
reproduction, dissemination, copying, disclosure, modification, distribution 
and/or publication of this e-mail message, contents or its attachment other 
than by its intended recipient/s is strictly prohibited.


Re: [R] ascii-grid export

2013-11-03 Thread Enzo Cocca
yes barry I really need this.

I tried to use raster or rgdal but with poor results.

I have this function:

VGM_PARAM_A3 - gstat(id=bos_bison,
formula=combusto~1,locations=~coord_x+coord_y, data=archezoology_table,
nmax = 10)

VGM_PARAM_A3 - gstat(VGM_PARAM_A3, model=vgm(1, Sph, 5, 0),
fill.all=TRUE)

ESV_A3 - variogram(VGM_PARAM_A3, map=True, with=0.1, cutoff=9)

VARMODEL_A3 = fit.lmc(ESV_A3, VGM_PARAM_A3)

plot(ESV_A3, threshold = 5, col.regions = bpy.colors(), xlab=, ylab=,
main=Map - A3)
png(C:\Users\User\pyarchinit_R_folder\A3 semivariogram_map.png,
width=1, height=1, res=400)

I make a png file but how can I convert it in ascii-grid?

thanks

enzo


2013/11/3 Barry Rowlingson b.rowling...@lancaster.ac.uk

 Or do you mean you want to write the gridded output of an
 interpolation you did (perhaps using kriging) in gstat as an ESRI
 ASCII Grid file for reading into a GIS?

 If so, you can probably do it with writeGDAL from the rgdal package,
 or writeRaster from the raster package.

 I don't really know what a 'semivariogram map' is.


 On Sat, Nov 2, 2013 at 8:55 AM, Enzo Cocca enzo@gmail.com wrote:
  hi,
 
  I want to export in ascii-grid file a semivariogram map that I have did
  with gstat library.
 
  How can I make it?
 
  Somebody can help me?
   thanks!
 
  enzo
  --
  Enzo Cocca (PhD Candidate)
  Research Fellow
  Università di Napoli L'Orientale
  mail: enzo@gmail.com
  cell: +393495087014
 
  [[alternative HTML version deleted]]
 




-- 
Enzo Cocca (PhD Candidate)
Research Fellow
Università di Napoli L'Orientale
mail: enzo@gmail.com
cell: +393495087014

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Control over character height, width, skew etc.?

2013-11-03 Thread Paul Murrell

Hi

R's text-drawing functions, such as text() or grid.text(), do NOT allow 
you to skew or stretch individual characters (like PostScript does). 
Your strategy of using PostScript to produce a result and then import 
the result as a shape for R to draw may work (if you can script it).


Paul

On 11/03/13 14:46, Iakub Henschen wrote:

I would like to add characters to R plots but need separate control over
height, width, skew, rotation etc. These parameters result from a
statistical computation within R. Also I need to be able to control stroke
and fill parameters independently. Finally, I need more than just ASCII
characters, but symbols and possibly Chinese/Japanese. What I've found so
far points to a solution where I send the character and scale information
to an external script that produces what I need in Postscript, then import
via the grImport package. I assume there is a more direct way via editing R
sources, such as inserting a transformation into text(), but that's
probably not a good idea in the long run. Or is there a better strategy?

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.



--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
R-help@r-project.org 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.