Re: [R] (no subject)

2010-07-24 Thread Paul Smith
2010/7/23 w 霍 hw_joyce...@hotmail.com: I use the constrOptim to maximize a function with four constriants but the answer does not leave from the starting value and there is only one outer iteration. The function is defined as follows: tm-function(p){ p1-p[1]; p2-p[2]; p3-p[3];

[R] Bug on r-bc?

2010-07-26 Thread Paul Smith
Dear All, The following code should return 1, but it returns 0: source(http://r-bc.googlecode.com/svn/trunk/R/bc.R;) bc(9 % 2) Do you confirm this bug? Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Bug on r-bc?

2010-07-26 Thread Paul Smith
On Mon, Jul 26, 2010 at 11:42 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: The following code should return 1, but it returns 0: source(http://r-bc.googlecode.com/svn/trunk/R/bc.R;) bc(9 % 2) See FAQ 2 on the r-bc package home page: http://r-bc.googlecode.com Thanks to all

Re: [R] Bug on r-bc?

2010-07-27 Thread Paul Smith
On Tue, Jul 27, 2010 at 5:12 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: The following code should return 1, but it returns 0: source(http://r-bc.googlecode.com/svn/trunk/R/bc.R;) bc(9 % 2) See FAQ 2 on the r-bc package home page: http://r-bc.googlecode.com Thanks to all

Re: [R] constrained optimization -which package?

2010-09-28 Thread Paul Smith
On Tue, Sep 28, 2010 at 9:47 PM, Leonardo Monasterio leonardo.monaste...@gmail.com wrote: In the function bellow I  want to find the maximum value of v, subject to the constrain that the sum of x is equal to 1.  I want to maximize: v-t(x)%*%distance%*%x Subject to: sum(x)=1 Where: x is a

[R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
Dear All, Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Thanks in advance, Paul __

Re: [R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
On Thu, Oct 22, 2009 at 5:31 PM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Do you mean a

Re: [R] Playing with rgl: a Youtube video

2009-12-21 Thread Paul Smith
On Mon, Dec 21, 2009 at 12:42 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: I've just posted a demo made with the rgl package to Youtube, visible here:  http://www.youtube.com/watch?v=prdZWQD7L5c For future reference, here are the steps I used: 1.  Design a shape to be displayed, and then

Re: [R] Inferences for ratios of non-normal means

2007-09-12 Thread Paul Smith
On 9/11/07, Paul Smith [EMAIL PROTECTED] wrote: The package mratios can perform inferences for ratios of normal means. Is there some other package to do the same but with non-normal populations. Since I have got large samples, an asymptotic procedure would be fine. Thanks for all replies. I

Re: [R] Matrix entries not recognised as numeric

2007-09-17 Thread Paul Smith
On 9/17/07, snapperball [EMAIL PROTECTED] wrote: I am using a number of large matrices in a project. I read a couple of the matrices using the read.csv command. However in some instances, R does not recognize the resulting matrices as consisting of numerical values (I suspect R considers them

[R] Plots with discontinuity balls

2007-09-27 Thread Paul Smith
Dear All, Can R plot graphs like the one at http://www.mathwords.com/f/f_assets/floor_graph.gif with the balls at the discontinuity points? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Paul Smith
Dear All, Can R draw plots of functions on a Cartesian coordinate system with axes like the ones shown at http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system-with-circle.svg ? I have already searched the R web-site, but found nothing. Thanks in advance, Paul

Re: [R] Graphics and LaTeX documents with the same font

2007-09-28 Thread Paul Smith
On 9/28/07, Frank E Harrell Jr [EMAIL PROTECTED] wrote: I know how to export graphics as pdf files and then how to include them in LaTeX documents. However, I do not know how to do in order to have the text of the graphics written with the font selected for the LaTeX document. Is that

Re: [R] Plots with discontinuity balls

2007-09-28 Thread Paul Smith
On 9/28/07, Duncan Murdoch [EMAIL PROTECTED] wrote: Can R plot graphs like the one at http://www.mathwords.com/f/f_assets/floor_graph.gif with the balls at the discontinuity points? You can use segments() to draw the segments and symbols() to draw the balls. For example,

Re: [R] Plots with discontinuity balls

2007-09-28 Thread Paul Smith
On 9/28/07, Duncan Murdoch [EMAIL PROTECTED] wrote: Can R plot graphs like the one at http://www.mathwords.com/f/f_assets/floor_graph.gif with the balls at the discontinuity points? You can use segments() to draw the segments and symbols() to draw the balls. For example,

Re: [R] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Paul Smith
(1, pos=0) axis(2, pos=0,at=c(-1,-0.5,0.5,1)) How can I have the y axis labels rotated clockwise? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charles Annis, P.E. Sent: Friday, September 28, 2007 11:32 AM To: 'Paul Smith'; 'r-help

Re: [R] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Paul Smith
On 9/28/07, Greg Snow [EMAIL PROTECTED] wrote: Look at the las argument in ?par for the easiest solution (can be passed to axis). Thanks a lot, Greg! That is it! Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Friday

[R] Problem with Palatino font in pdf figures

2007-09-30 Thread Paul Smith
Dear All, Consider the following piece of code: pdf(file=figure.pdf, family=Palatino) plot(0,0,type='n', xlim=c(-20,20), ylim=c(0,2),xlab=,ylab=,axes=F) text(-1.4,1.168,expression(italic(The font looks different when this is seen with Acrobat Reader!)),xpd=T) dev.off() When viewing the produced

Re: [R] Problem with Palatino font in pdf figures

2007-09-30 Thread Paul Smith
On 9/30/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: Consider the following piece of code: pdf(file=figure.pdf, family=Palatino) plot(0,0,type='n', xlim=c(-20,20), ylim=c(0,2),xlab=,ylab=,axes=F) text(-1.4,1.168,expression(italic(The font looks different when this is seen with

Re: [R] Plotmath integral gets horrible with URWPalladio

2007-10-03 Thread Paul Smith
On 10/3/07, Paul Murrell [EMAIL PROTECTED] wrote: With the following code: pdf(file=figure.pdf,family=URWPalladio) plot(0,0,type=n) text(0,0,expression(integral(f(x)*dx, a, b))) dev.off() the integral symbol gets horrible. With other fonts, the same does not occur. Is there some

[R] embedFonts rotates figure

2007-10-08 Thread Paul Smith
Dear All, Consider the following code: pdf(file=figure.pdf,family=URWPalladio) curve(dlnorm(x,0,1.5),0,10,xlim=c(0,10),ylim=c(0,0.85),axes=F,xlab=,ylab=f) segments(exp(-1.5^2),0,exp(-1.5^2),dlnorm(exp(-1.5^2),0,1.5),lty=dashed) segments(1,0,1,dlnorm(1,0,1.5),lty=dashed)

Re: [R] How to identify the two largest peaks in a trimodal distribution

2007-10-13 Thread Paul Smith
On 10/13/07, Rob Knell [EMAIL PROTECTED] wrote: I'm trying to do a simulation that involves identifying the minimum point between two peaks of a (usually) bimodal distribution. I can do this easily if there are only two peaks: CnBdens-density(Ys/Xs) #probability density function for ratio of

[R] Multi-objective optimization

2007-10-17 Thread Paul Smith
Dear All, Is there any package to do multi-objective optimization? For instance, consider the following problem: maximize f(x,y) in order to x and maximize g(x,y) in order to y, simultaneously, with x and y being the same both for f and g. Can R do it numerically? Thanks in advance, Paul

Re: [R] Multi-objective optimization

2007-10-17 Thread Paul Smith
On 10/17/07, Alberto Monteiro [EMAIL PROTECTED] wrote: Is there any package to do multi-objective optimization? For instance, consider the following problem: maximize f(x,y) in order to x and maximize g(x,y) in order to y, simultaneously, with x and y being the same both for f

Re: [R] Multi-objective optimization

2007-10-18 Thread Paul Smith
On 10/17/07, Ravi Varadhan [EMAIL PROTECTED] wrote: What if simultaneously maximizing f(x,y) and g(x,y) is an incompatible objective? Modifying Duncan's example slightly, What if: f(x,y) = -(x-y)^2 and g(x,y) = -(x-2)^2-(y-x-1)^2? Here: (1) = x = y (2) = y = x + 1 (3) =

Re: [R] save as pdf

2007-10-22 Thread Paul Smith
On 10/22/07, Denis Aydin [EMAIL PROTECTED] wrote: I just wanted to save a graphic in the pdf-format. But id failed: Fehler: Invalid font type Zusätzlich: Warning messages: 1: font family not found in PostScript font database 2: font family not found in PostScript font database I use R

[R] Multivariate integration with infinite limits

2007-11-09 Thread Paul Smith
Dear All, Can R perform multivariate integration with infinite limits of integration? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Multivariate integration with infinite limits

2007-11-10 Thread Paul Smith
On Nov 10, 2007 12:43 PM, Uwe Ligges [EMAIL PROTECTED] wrote: Can R perform multivariate integration with infinite limits of integration? No, R does numerical (not symbolical) calculations, hence it can never perform integration (not even univariate) with infinite limits. Not entirely true

Re: [R] How to log-2 transform a matrix

2007-11-10 Thread Paul Smith
On Nov 10, 2007 2:25 PM, affy snp [EMAIL PROTECTED] wrote: I am wondering how to log-2 based transform a matrix with numeric values? I tried CGHlog2-log2(CGH) but got an error. Then I found for log2(x) in R, the x has to be a numeric or complex vector. Any method for a matrix? One can use

Re: [R] How to log-2 transform a matrix

2007-11-10 Thread Paul Smith
On Nov 10, 2007 2:49 PM, affy snp [EMAIL PROTECTED] wrote: My matrix looks like: dim(CGH) [1] 238304243 CGH[1:30,1:4] WM806SignalA WM1716SignalA WM1862SignalA WM1963SignalA SNP_A-1909444 1.59 1.48 1.78 2.59 SNP_A-2237149 2.24

[R] Bug with curve?

2008-02-01 Thread Paul Smith
Dear All, Take this code: f - function(x) exp(-x)*x-0.05 g - function(x) 0 curve(f,0,5) curve(g,add=T) Error in xy.coords(x, y) : 'x' and 'y' lengths differ However, with g - function(x) x-x no error is generated. Is this a bug? I am using version _ platform

Re: [R] Bug with curve?

2008-02-01 Thread Paul Smith
On Feb 1, 2008 2:46 PM, Martin Maechler [EMAIL PROTECTED] wrote: Take this code: f - function(x) exp(-x)*x-0.05 g - function(x) 0 curve(f,0,5) curve(g,add=T) Error in xy.coords(x, y) : 'x' and 'y' lengths differ However, with

Re: [R] numerical integration of a ftn of 2 variables

2008-02-21 Thread Paul Smith
On Tue, Feb 19, 2008 at 11:07 PM, Chris Rhoads [EMAIL PROTECTED] wrote: To start, let me confess to not being an experienced programmer, although I have used R fairly extensively in my work as a graduate student in statistics. I wish to find the root of a function of two variables that

[R] N-way ANOVA

2008-03-05 Thread Paul Smith
Dear All, Can R perform n-way ANOVA, i.e., with 3 or more factors? Thanks in advance, 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

Re: [R] N-way ANOVA

2008-03-05 Thread Paul Smith
On Wed, Mar 5, 2008 at 7:41 PM, Prof Brian Ripley [EMAIL PROTECTED] wrote: Can R perform n-way ANOVA, i.e., with 3 or more factors? Yes. There are even examples on the help page! Thanks, Prof. Ripley. I will have a look at it. Paul __

[R] Problems with installing the rgl package on Linux

2008-03-08 Thread Paul Smith
Dear All, I am trying to install the rgl package on R 2.6.1 running on Fedora 8 (Linux), but I am experiencing the following problems: - configure: error: X11 not found but required, configure aborted. ERROR: configuration failed for package 'rgl' **

Re: [R] Problems with installing the rgl package on Linux

2008-03-10 Thread Paul Smith
On Sat, Mar 8, 2008 at 5:33 PM, George N. White III [EMAIL PROTECTED] wrote: I am trying to install the rgl package on R 2.6.1 running on Fedora 8 (Linux), but I am experiencing the following problems: - configure: error: X11 not found but

Re: [R] box-constrained

2008-03-10 Thread Paul Smith
On Sun, Mar 9, 2008 at 9:10 PM, Gustave Lefou [EMAIL PROTECTED] wrote: I have another question. I have seen there is a function called constrOptim in R. Is it better than optim, for example to optimize a function f of two parameters belonging to [0,1] and [0,Infinity] ? Do the methods

[R] Changing font size of Rcmdr (Linux)

2008-03-10 Thread Paul Smith
Dear All, I have Rcmdr installed on a machine running Fedora 8 (Linux). It works fine, but I find the fonts of the Script window and of Output window very small. How can one increase the size of the font use on those windows? Thanks in advance, Paul

Re: [R] Changing font size of Rcmdr (Linux)

2008-03-10 Thread Paul Smith
] On Behalf Of Paul Smith Sent: March-10-08 8:20 AM To: r-help Subject: [R] Changing font size of Rcmdr (Linux) Dear All, I have Rcmdr installed on a machine running Fedora 8 (Linux). It works fine, but I find the fonts of the Script window and of Output window very small. How

Re: [R] box-constrained

2008-03-10 Thread Paul Smith
2008/3/10, Paul Smith [EMAIL PROTECTED]: On Sun, Mar 9, 2008 at 9:10 PM, Gustave Lefou [EMAIL PROTECTED] wrote: I have another question. I have seen there is a function called constrOptim in R. Is it better than optim, for example to optimize a function f of two

Re: [R] Optimization with constraint.

2008-03-15 Thread Paul Smith
On Fri, Mar 14, 2008 at 6:42 PM, Hans W Borchers [EMAIL PROTECTED] wrote: I have some problems, when I try to model an optimization problem with some constraints. The original problem cannot be solved analytically, so I have to use routines like Simulated Annealing or Sequential

Re: [R] rgl build warnings and loading error on Linux

2008-03-17 Thread Paul Smith
On Sun, Mar 16, 2008 at 7:38 PM, Liviu Andronic [EMAIL PROTECTED] wrote: I have several problems in using rgl-0.77 (and recent earlier versions) on Gentoo Linux with a custom-built v. 2.6.22 kernel. Currently I use R-2.6.1. When I build rgl, # R CMD INSTALL

Re: [R] Optimization with nonlinear constraints

2008-03-26 Thread Paul Smith
On Wed, Mar 26, 2008 at 1:17 PM, Andreas Klein [EMAIL PROTECTED] wrote: I have some further problems with modelling an optimization problem in R: How can I model some optimization problem in R with a linear objective function with subject to some nonlinear constraints? I would like to

Re: [R] generate random numbers subject to constraints

2008-03-26 Thread Paul Smith
On Wed, Mar 26, 2008 at 7:27 PM, Ala' Jaouni [EMAIL PROTECTED] wrote: I failed to mention that the X values have to be positive and between 0 and 1. Use Robert's method, and to do his step 1, use runif (?runif) to get random numbers from the uniform distribution between 0 and 1. Paul

[R] Cannot update packages on F8

2008-03-27 Thread Paul Smith
Dear All, I have just updated R to the version 2.6.2 on F8 (with the official F8 rpm). However, when running as root the following command: update.packages(checkBuilt=T) I get a bunch of errors like the ones below. Any ideas? Thanks in advance, Paul

Re: [R] Cannot update packages on F8

2008-03-27 Thread Paul Smith
On Thu, Mar 27, 2008 at 10:20 PM, Marc Schwartz [EMAIL PROTECTED] wrote: I have just updated R to the version 2.6.2 on F8 (with the official F8 rpm). However, when running as root the following command: update.packages(checkBuilt=T) I get a bunch of errors like the ones below.

Re: [R] DE optimization with equality constraint

2008-03-29 Thread Paul Smith
On Sat, Mar 29, 2008 at 9:33 PM, Hans W. Borchers [EMAIL PROTECTED] wrote: Reply to Optimization with constraint on March 14, 2008 One can get an accurate solutons applying the Differential Evolution algorithm as implemented in the DEoptim package: f2 - function(x){ if

[R] L-BFGS-B needs finite values of 'fn'

2008-03-31 Thread Paul Smith
Dear All, I am trying to solve the optimization problem below, but I am always getting the following error: Error in optim(rep(20, nvar), f, gr, method = L-BFGS-B, lower = rep(0, : L-BFGS-B needs finite values of 'fn' Any ideas? Thanks in advance, Paul

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-03-31 Thread Paul Smith
a function without a lower bound. Using the trace facilities of optim() would have got you thereeasily enough. On Mon, 31 Mar 2008, Paul Smith wrote: Dear All, I am trying to solve the optimization problem below, but I am always getting the following error: Error in optim(rep

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-03-31 Thread Paul Smith
(x)) - 200*(sum(x)-k)^2 if(!is.finite(r)) r-1e+20 return(r) } have a nice day. On Mon, 31 Mar 2008 12:24:09 +0100 Paul Smith wrote: Dear All, I am trying to solve the optimization problem below, but I am always getting the following error: Error in optim(rep(20, nvar), f

[R] Looking for Rdonlp2

2009-06-27 Thread Paul Smith
Dear All, I tried to download the package Rdonlp2 from the address given at CRAN Task View: Optimization and Mathematical Programming: http://arumat.net/Rdonlp2/ However, this link seems to be dead. Any ideas? Thanks in advance, Paul __

Re: [R] Looking for Rdonlp2

2009-06-28 Thread Paul Smith
Thanks, Mario. With a different browser, it works, but not with Firefox 3.5b4. Paul On Sat, Jun 27, 2009 at 7:19 PM, Mario Vallemva...@cscs.ch wrote: Retry, it works for me. Ciao!               mario Paul Smith wrote: Dear All, I tried to download the package Rdonlp2 from the address

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
On Fri, Aug 15, 2008 at 6:15 PM, John Sorkin [EMAIL PROTECTED] wrote: Fedora 9 R 2.7.1 I tried to install R on my Linux system using install.packages(Rcmdr, dependencies=TRUE). I received many, many, many error messages. I hope someone can suggest a fix. The output from warnings() is

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) [EMAIL PROTECTED] Paul Smith [EMAIL PROTECTED] 08/15/08 4:02 PM On Fri, Aug 15, 2008 at 6:15 PM, John Sorkin [EMAIL

Re: [R] nonlinear constrained optimization

2008-08-19 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:35 AM, Chua Siang Li [EMAIL PROTECTED] wrote: Hi. I need some advises on how to use R to find pi (i is the index) with the following objective function and constraint: max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ] s.t. (sum i)[ f(ai, bi, pi) * Di *

Re: [R] nonlinear constrained optimization

2008-08-20 Thread Paul Smith
On Tue, Aug 19, 2008 at 7:37 PM, Ravi Varadhan [EMAIL PROTECTED] wrote: The Tango project website (from Brazil) has some R functions to implement Algencan. I haven't used it, but I would be interested to hear others' experience if someone has already used it or will be using it. Ravi, The

Re: [R] nonlinear constrained optimization

2008-08-20 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:12 PM, Hans W. Borchers [EMAIL PROTECTED] wrote: Please have a look at the 'Rdonlp2' package at http://arumat.net/Rdonlp2/. It provides non-linear optimization with nonlinear constraints. Notwithstanding, be aware of the following limitation of Donlp2: If the problem

Re: [R] new to R

2008-09-06 Thread Paul Smith
On Sat, Sep 6, 2008 at 5:10 AM, sudeshna [EMAIL PROTECTED] wrote: hi im starting with R.have no idea to start...plz help Search the Internet for online tutorials and/or read an introductory book (search for them, e.g., on Amazon.Com). Good luck, Paul

[R] How to draw the graph of f(x,y) = x * y ?

2008-09-23 Thread Paul Smith
Dear All, The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? Thanks in advance, Paul __ R-help@r-project.org mailing list

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-23 Thread Paul Smith
On Tue, Sep 23, 2008 at 6:32 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? No, you would have to write it yourself. The basic idea is to use outer() to

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-24 Thread Paul Smith
On Wed, Sep 24, 2008 at 4:05 AM, Ben Bolker [EMAIL PROTECTED] wrote: The function curve() draws the graph of functions from R to R. Is there some homologous function to curve() to draw functions from R^2 to R? There is a curve3d function in the emdbook package on CRAN. Thanks, Ben and

[R] Bug in persp?

2008-09-24 Thread Paul Smith
Dear All, I am not sure whether the following can be considered a bug: x - seq(-1,1,length=20) y - x z - matrix(1,20,20) persp(x,y,z) Error in persp.default(x, y, z) : invalid 'z' limits It works with: persp(x,y,z,zlim=c(0,1.5)) Should not persp set the z limits by default when the matrix

Re: [R] How to draw the graph of f(x,y) = x * y ?

2008-09-24 Thread Paul Smith
means a 2-D curve will be extruded along the Y dimension. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Wednesday, September 24, 2008 06:20 To: [EMAIL PROTECTED] Subject: Re: [R] How to draw the graph of f(x,y) = x * y ? On Wed, Sep

Re: [R] Can R do this ?

2008-07-08 Thread Paul Smith
On Tue, Jul 8, 2008 at 6:59 AM, Daren Tan [EMAIL PROTECTED] wrote: I have a folder full of pngs and jpgs, and would like to consolidate them into a pdf with appropriate title and labels. Can this be done via R ? I do not know whether R can do that. However, you can accomplish that easily with

Re: [R] Constrained optimization

2008-07-08 Thread Paul Smith
On Tue, Jul 8, 2008 at 11:28 AM, Kanak Choudhury [EMAIL PROTECTED] wrote: i have a function like 1+sin(a+bx) where -pi/2=a+bx=pi/2 i made a progrom using constrOptim() function but it is not giving good result. it depends on the initial value. but when i am doing simulation it is impossible

Re: [R] drawing segments through points with pch=1

2008-07-20 Thread Paul Smith
On Sun, Jul 20, 2008 at 1:44 PM, David Epstein [EMAIL PROTECTED] wrote: Please excuse me for asking such basic questions: Here is my code y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12) ybar=mean(y) ll=length(y); ybarv=rep(ybar,ll) x=1:ll plot(x,ybarv,pch=1)

Re: [R] asp and ylim

2008-07-20 Thread Paul Smith
On Sun, Jul 20, 2008 at 11:14 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try lattice: library(lattice) xyplot(y ~ x, ylim = c(0.5, 0.7), aspect = iso) Alternatively, set.seed(42) x - runif(10) y - runif(10) plot(x[(y=0.5) (y=0.7)],y[(y=0.5) (y=0.7)],ylim=c(0.5,0.7),asp=1) Paul

Re: [R] Accessing individual variables from summary of lm

2008-07-22 Thread Paul Smith
On Tue, Jul 22, 2008 at 5:44 AM, ascentnet [EMAIL PROTECTED] wrote: I am trying to access the R2, intercept, and slope out of the summary from an lm so that I can insert it into a database using RODBC. How can I access these individually? Try: data(swiss) model - lm(Infant.Mortality ~

Re: [R] Fwd: Re: Nonlinear equation

2008-04-02 Thread Paul Smith
On Wed, Apr 2, 2008 at 5:05 PM, [EMAIL PROTECTED] wrote: hi: you need to give an example and details or you won't get much response, if any. Equation e.g. (A, B are known constants): 3log(gamma(x))-log(gamma(x)*gamma(2x))+(x-1)*A+B=0 uniroot() can solve that if you can

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-04-02 Thread Paul Smith
/agingandhealth/People/Faculty/Varadhan.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith Sent: Monday, March 31, 2008 2:25 PM To: R-help

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-04-03 Thread Paul Smith
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ravi Varadhan Sent: Wednesday, April 02, 2008 2:03 PM To: 'Paul Smith'; 'R-help' Subject: Re: [R] L-BFGS-B needs finite values of 'fn' Yes, that is very important. If you look at the ratios x[k]/x[k-1], they are very close

Re: [R] Extracting a data.frame from HTML code

2008-04-13 Thread Paul Smith
On Sun, Apr 13, 2008 at 12:37 AM, Martin Morgan [EMAIL PROTECTED] wrote: Hi Ethan -- Use the XML library library(XML) url - 'http://www.nascar.com/races/cup/2007/1/data/standings_official.html' xml - htmlTreeParse(url, useInternal=TRUE) The previous line retrieves the html and

Re: [R] Skipping specified rows in scan or read.table

2008-04-13 Thread Paul Smith
On Wed, Apr 9, 2008 at 7:37 PM, Ravi Varadhan [EMAIL PROTECTED] wrote: I have a data file, certain lines of which are character fields. I would like to skip these rows, and read the data file as a numeric data frame. I know that I can skip lines at the beginning with read.table and scan,

Re: [R] Minimise a parameter of a given function f, with f 0

2008-04-24 Thread Paul Smith
On Wed, Apr 23, 2008 at 8:51 PM, Kevin Lu [EMAIL PROTECTED] wrote: I need to find the minimum value of the parameter, s, such that the function f(s,t) 0 (where -Inf t Inf) I've looked into optim, constrOptim and others but they don't seem to do this. Des anyone have some suggestions?

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
2008/4/25 Radka Pancheva [EMAIL PROTECTED]: I am trying to estimate the parameters of a bimodal normal distribution using moments matching, so I have to solve a non-linear system of equations. How can I solve the following simple example? x^2 - y^2 = 6 x – y = 3 I heard about

Re: [R] Non-linear system of equations

2008-04-25 Thread Paul Smith
Try to change the initial values of the parameters with, for instance, p0 - rnorm(2) But you sure that your system has a solution, Evgeniq? Paul 2008/4/25 Radka Pancheva [EMAIL PROTECTED]: Hello Paul, Thank you for your quick answer. I have tried to use your advice and to estimate the

Re: [R] Why R is 200 times slower than Matlab ?

2008-05-01 Thread Paul Smith
On Thu, May 1, 2008 at 12:31 AM, Nelson Castillo [EMAIL PROTECTED] wrote: Aside from optiming your code by making use of R functions that use C underneath as much as possible the big difference between R and Matlab is Matlab's just-in-time compilation of code. When that was

Re: [R] Pros and Cons of R

2008-05-22 Thread Paul Smith
On Thu, May 22, 2008 at 5:00 PM, Monica Pisica [EMAIL PROTECTED] wrote: - It seems that it is hard to install correctly under Linux. Actually, it is quite easy to install R under Linux, at least in some distributions. For instance, on Fedora: yum install R R-devel and that is it. Paul

Re: [R] optimization setup

2008-05-30 Thread Paul Smith
On Fri, May 30, 2008 at 12:04 PM, threshold [EMAIL PROTECTED] wrote: Thanks for all your replies and sorry for a negligence in my examples. They are very simplified to reflect very roughly the structure of the case I deal with, which is too complicated to be quoted here. What I deal with is:

Re: [R] Swap variables in data.frame

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 11:59 AM, Blubbele [EMAIL PROTECTED] wrote: Thanks but it swaps in both cases only the data: FemMal_88[c(61,62)]=FemMal_88[c(62,61)] FemMal_88[,c(61,62)]=FemMal_88[,c(62,61)] The following works: d - data.frame(a=c(1,2),b=c(3,4)) d - d[,c(2,1)] Paul

Re: [R] Swap variables in data.frame

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 1:04 PM, Birgitle [EMAIL PROTECTED] wrote: Thanks Paul. I am not sure if I understood well, but when I do it then I have only two columns left: L3 - LETTERS[1:3] (d - data.frame(cbind(x=1, y=1:10, z=11:20), fac=sample(L3, 10, replace=TRUE))) x y z fac 1 1 1

Re: [R] How can I solve this function in R?

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 4:31 PM, François Aucoin [EMAIL PROTECTED] wrote: I would like to solve the following function in R: G - function(k) (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k) I want to be able to find k for a given G Consider G(k)-g. With plot look for intervals where the roots lie in.

Re: [R] txt file, 14000+ rows, only last 8000 appear

2008-06-07 Thread Paul Smith
On Fri, Jun 6, 2008 at 10:30 PM, RobertsLRRI [EMAIL PROTECTED] wrote: when I load my data file in txt format into the R workstation I lose about 6000 rows, this is a problem. Is there a limit to the display capabilities for the workstation? is all the information there and I just can't see

Re: [R] Need to run R on Fedora 9.

2008-06-08 Thread Paul Smith
On Sun, Jun 8, 2008 at 9:33 AM, Peter Dalgaard [EMAIL PROTECTED] wrote: I'm in need of a version of R that will run on fedora 9 and haven't been able to find one. I need this in order to run Bioconductor. Any advice? Why not say (as root) yum install R ? Worked for me. The point is

Re: [R] is there a way to read a specific column from a txt file

2009-05-03 Thread Paul Smith
On Sun, May 3, 2009 at 6:36 PM, Wensui Liu liuwen...@gmail.com wrote: Sometimes, it is too costly to read the whole data file into R. I am looking for solution in scan() and read.Lines() but don't they work. Try the following (assuming a 3 columns data file): mydata -

[R] Code of the max() function

2009-05-04 Thread Paul Smith
Dear All, Where can one find the code of the max() function? Is that written in C? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Code of the max() function

2009-05-04 Thread Paul Smith
On Mon, May 4, 2009 at 7:47 PM, David Winsemius dwinsem...@comcast.net wrote: Where can one find the code of the max() function? Is that written in C? pages 43-54 of: http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf ... is an article by Uwe Ligges on accesssing source code. Thanks,

[R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Dear All, Perhaps, what I am asking is impossible, but I am asking it anyway. I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Thanks, Baptiste and Zeljko. I am attaching here an example of the picture of the rectangles. Paul On Tue, May 12, 2009 at 1:23 PM, baptiste auguie ba...@exeter.ac.uk wrote: Depending on the nature of your pdf file, it may be possible to use the grImport package. I've never used it before,

Re: [R] Fwd: From two colors to 01 sequences

2009-05-12 Thread Paul Smith
On Tue, May 12, 2009 at 2:35 PM, Zeljko Vrba zv...@ifi.uio.no wrote: Aha, so you DON'T have only red and green rectangles in the picture, there is also white in between, and some pale delimiter lines.  Nevertheless, both things ease the job slightly, and the approach I described should work.  

Re: [R] Optimization Question

2009-06-12 Thread Paul Smith
On Thu, Jun 11, 2009 at 9:56 PM, Brecknock, Peterpeter.breckn...@bp.com wrote: Apologies if this is not the correct list for this question. The Rglpk package offers the following example in its documentation library(Rglpk) ## Simple mixed integer linear program. ## maximize: 3 x_1 + 1 x_2 +

Re: [R] R det

2007-11-16 Thread Paul Smith
On Nov 16, 2007 7:27 PM, kalin lagno [EMAIL PROTECTED] wrote: Which R function I should use to obtain determinant of a matrix with real(and complex) numbers? For real matrices: ?det Paul __ R-help@r-project.org mailing list

[R] Exporting a plot with the LaTeX font lmodern

2007-11-18 Thread Paul Smith
Dear All, I would like to export, as a pdf file, a plot with the LaTeX font lmodern as the font of my graph. Could somebody please help me? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Getting theta in italic in a plot

2007-11-18 Thread Paul Smith
Dear All, Consider the following code: plot(0,0) text(0,0.5,expression(italic(theta))) I would like to get theta in italic, but I always get it upright. Any suggestions? Thanks in advance, Paul __ R-help@r-project.org mailing list

Re: [R] Exporting a plot with the LaTeX font lmodern

2007-11-18 Thread Paul Smith
On Nov 18, 2007 8:04 PM, Paul Smith [EMAIL PROTECTED] wrote: I would like to export, as a pdf file, a plot with the LaTeX font lmodern as the font of my graph. Could somebody please help me? I have tried the following but with no success: pdf(file=myplot.pdf,family=ComputerModern) Error

[R] Dot plots in R

2007-11-24 Thread Paul Smith
Dear All, Can R produce dot plots like the one of the following picture: http://en.wikipedia.org/wiki/Image:Dotplot_of_random_values.png ? I have tried dotchart, but no success. Thanks in advance, Paul __ R-help@r-project.org mailing list

Re: [R] Dot plots in R

2007-11-24 Thread Paul Smith
On Nov 24, 2007 9:57 PM, jim holtman [EMAIL PROTECTED] wrote: Does this give you want you want? x - sample(1:10) plot(rep(1:10, x), unlist(sapply(x, seq)), pch=19, cex=3, yaxt='n') On Nov 24, 2007 4:26 PM, Paul Smith [EMAIL PROTECTED] wrote: Dear All, Can R produce dot plots like

Re: [R] Dot plots in R

2007-11-24 Thread Paul Smith
On Nov 24, 2007 10:11 PM, A. Beaujean [EMAIL PROTECTED] wrote: ?stripchart shows the at command e.g., stripchart(data, method=stack, pch=16, at=0) That is perfect! Thanks. Paul __ R-help@r-project.org mailing list

[R] Customizing x-axis with stripchart

2007-11-24 Thread Paul Smith
Dear All, With plot, one can use to the option 'axes=F' to remove axes. I have tried it with stripchart, but no success. How can one then customize the x-axis with stripchart? Thanks in advance, Paul __ R-help@r-project.org mailing list

  1   2   >