[R] how to change the position of xlab in truehist?

2010-04-16 Thread Hua Li
Hi, I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin corresponds to each of the discrete case. I was

Re: [R] how to change the position of xlab in truehist?

2010-04-18 Thread Hua Li
Thanks, Peter. It works! Hua --- On Fri, 4/16/10, Peter Ehlers ehl...@ucalgary.ca wrote: From: Peter Ehlers ehl...@ucalgary.ca Subject: Re: [R] how to change the position of xlab in truehist? To: Hua Li huali...@yahoo.com Cc: r-help@r-project.org Date: Friday, April 16, 2010, 6:23 PM

[R] help on drawing a tree with ape?

2007-11-11 Thread Hua Li
Dear all, I'm using the ape package in R and want to draw a phylogenetic tree with not only the tip labels but also some labels for the edges. e.g. Mark the edge AB as m in the tree ABC. Couldn't find a way to do that. Can someone help? Thanks, Hua

Re: [R] help on drawing a tree with ape?

2007-11-12 Thread Hua Li
: Hua Li wrote: Dear Simon and everyone, Thanks for response. Specifically, I have a tree with species A, B, C and can be written as ((A:45.15,C:45.15):46.19,B:91.34):0.0; . If I use the R command mytreeABC [1] ((A:45.15,C:45.15):46.19,B:91.34):0.0; plot

[R] the title is too long for a graph

2008-06-10 Thread Hua Li
Hi All, I have a problem of putting long titles on a graph: for example, x= seq(1:100) y=seq(1:100) plot(x,y,main=p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4) R seems not able to print the whole title. The title

Re: [R] the title is too long for a graph

2008-06-11 Thread Hua Li
Thank you all! The answers are very helpful! Best regards, Hua --- On Wed, 6/11/08, Prof Brian Ripley [EMAIL PROTECTED] wrote: Hua Li wrote: Hi All, I have a problem of putting long titles on a graph: for example, x= seq(1:100) y=seq(1:100) plot(x,y,main=p=0.05:A-B

[R] numbers as part of long character

2008-06-12 Thread Hua Li
Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character. For example, outtree.new=(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:17139.21); num.char =

Re: [R] numbers as part of long character

2008-06-12 Thread Hua Li
PROTECTED] Cc: [EMAIL PROTECTED], r-help@r-project.org Date: Thursday, June 12, 2008, 6:03 PM On Jun 12, 2008, at 5:06 PM, Marc Schwartz wrote: on 06/12/2008 03:46 PM Hua Li wrote: Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character

Re: [R] numbers as part of long character

2008-06-12 Thread Hua Li
, June 12, 2008, 6:03 PM On Jun 12, 2008, at 5:06 PM, Marc Schwartz wrote: on 06/12/2008 03:46 PM Hua Li wrote: Hi, I'm looking for some way to pick up the numbers which are contained and buried in a long character. For example, outtree.new=(((B:1204.25,E:1204.25):7581.11,F:8785.36

[R] stop unwanted boxes/dialogs in tcl/tk

2008-06-17 Thread Hua Li
Hello, I have a question about tcl/tk: is there a way to stop more messagers/listchoice/etc. that are set up earlier, but are unwanted later? for example, require(tcltk) ttMain - tktoplevel() tkwm.title(ttMain,Question) f.fcn - function(){ t1 - modalDialogOK(Elicitation,What's the LOWER

[R] create .exe file with R?

2008-06-19 Thread Hua Li
Dear all, I'm writing to check with you whether there is a way to create .exe file(or something like that) with R. Now working on creating a program to take inputs from users (with tcl/tk), I would appreciate any idea to make the program run on its own rather than every time having to run my

[R] print one character on several lines

2008-06-19 Thread Hua Li
Hi All, I'm wondering how I can print one large/long character on several lines so that the output will not overflow a page. Setting fill be TRUE or even numbers does not help. An example is below: ipuFile - file(input.txt, w) cat(This is a very long character and I want to print

[R] ignore warning messages?

2008-07-01 Thread Hua Li
Hi All, I'm working with R and want to ignore the warning messages given, is there a way to stop R from giving out warning messages any more? an example: tt = test as.numeric(tt) would give me the following message: [1] NA Warning message: NAs introduced by coercion I decide to ignore the

Re: [R] ignore warning messages?

2008-07-06 Thread Hua Li
options(warn=-1) tt = test as.numeric(tt) [1] NA See also ?options for more info. HTH, Jorge On Tue, Jul 1, 2008 at 12:11 PM, Hua Li [EMAIL PROTECTED] wrote: Hi All, I'm working with R and want to ignore the warning messages given, is there a way to stop R from giving

[R] color with tcl/tk?

2008-07-06 Thread Hua Li
Dear all, I'm using tcl/tk to create a program to get answers from the user. I'd like a way to highlight/emphasize some of the information using colors. It'll be even better if I can color part of the messages instead of the whole thing. For example, I want to put the word Hello in red:

[R] position of a specific character

2008-07-14 Thread Hua Li
Hi All, I'm wondering whether there is a quick way to know the position of a specific charcater in a long character: for example frg=((D:41.04,I:41.04):45.05,(((E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21) and I would like to know that the 1st, 2nd, 26th, 27th, 28th ... character is (, is

Re: [R] position of a specific character

2008-07-14 Thread Hua Li
:0.67):0.44,H:1.11):1.21) automatically! Thanks a lot! Hua --- On Mon, 7/14/08, Hua Li [EMAIL PROTECTED] wrote: From: Hua Li [EMAIL PROTECTED] Subject: [R] position of a specific character To: R-help r-help@r-project.org Date: Monday, July 14, 2008, 6:57 PM Hi All, I'm wondering

Re: [R] help on drawing a tree with ape?

2007-11-16 Thread Hua Li
rather a way R finds out itself. (for example, after some calculation, R knows the edgelabes should be the way specified above other than, say, c(a, b, c, a-b, a-c, b-c). ) Thank you! Hua --- Ben Bolker [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hua Li wrote

[R] use save.image inside a function?

2008-01-09 Thread Hua Li
Hi, All I'm trying to save the workspace as a Check Point for possible future come back. The save.image function works if the whole coding is in a main function: rm(list=ls()) t = 1 t = t+1 print(paste(before,t)) # [1] before 2 save.image(tt.RData) t = t+1 print(paste(after,t)) # [1] after 3

[R] disappearing dialog boxes when using tcltk

2009-04-14 Thread Hua Li
Dear all, I'm trying to use tcltk to build a small user-interface and couter the problem: It seems that sometimes the dialog box will be minimized automatically though I want it to be on top of the screen all the time. For example, when runing the following code, if you type in a1, a2, a3,

[R] R book needed

2008-10-09 Thread Hua Li
Hi there, I'm looking for advice on a R book that's for somewhat advanced user. I've been using R for a while and can do the basic analysis with no problem. My problem is that for many already existing commands, such as gsub, textconnection, list, etc, I don't use them, simply because I don't

[R] change the label size when drawing trees with ape

2009-02-19 Thread Hua Li
Hi All, I want to be able to change the labe size on a tree when using ape package so that the graph can look nicer, but don't know how. Playing with the font doesn't seem to help. (Right now the labels barely show.) Thanks for your help! Code I'm using now #- t1 =

[R] Install package of BRugs?

2010-03-30 Thread Hua Li
Hi All, I'm trying to install the package BRugs and could not find it on the install package list. Then I tried the suggestion to run the following command in R install.packages(BRugs) but get the following error message: Loading required package: BRugs Warning message: In library(package,

[R] Fw: Install package of BRugs?

2010-03-30 Thread Hua Li
Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'BRugs' library(BRugs) Error in library(BRugs) : there is no package called 'BRugs' --- On Tue, 3/30/10, Hua Li huali...@yahoo.com wrote: From: Hua Li huali

Re: [R] Install package of BRugs?

2010-03-31 Thread Hua Li
Thanks! I updated R to 2.10.1 and everything is fine now! Hua --- On Wed, 3/31/10, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: From: Uwe Ligges lig...@statistik.tu-dortmund.de Subject: Re: [R] Install package of BRugs? To: David Winsemius dwinsem...@comcast.net Cc: Hua Li huali