Re: [R] Error running lda example from Help File (MASS library )

2009-11-14 Thread Ronggui Huang
-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Wincent Ronggui HUANG Doctoral Candidate Dept of Public and Social Administration City University of Hong Kong http://asrr.r-forge.r-project.org/rghuang.html

Re: [R] creating custom package and functions

2009-11-10 Thread Ronggui Huang
. -- Wincent Ronggui HUANG Doctoral Candidate Dept of Public and Social Administration City University of Hong Kong http://asrr.r-forge.r-project.org/rghuang.html __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] RGtk2:::gdkColorToString throws an error

2009-10-20 Thread Ronggui Huang
Dear all, I try to use RGtk2:::gdkColorToString, but it throws an error: Error in .RGtkCall(S_gdk_color_to_string, object, PACKAGE = RGtk2) : gdk_color_to_string exists only in Gdk = 2.12.0 I know what it means, but don't know to solve this problem because I don't know where I can download the

Re: [R] CRAN (and crantastic) updates this week

2009-08-24 Thread Ronggui Huang
I like it. Thanks. 2009/8/24 hadley wickham crana...@gmail.com: Sorry, we had some problems with the initial sending of our weekly digest which resulted in a rather empty email. Here is the correct version: CRAN (and crantastic) updates this week New packages * atm (0.1.0)

Re: [R] Removing objects from workspace

2009-08-24 Thread Ronggui Huang
It depends. If there are patterns in the names, you can make use of pattern argument of ls(). For example, x1=a;x2=b;x3=c ls(pattern=x[1-2]) [1] x1 x2 ls(pattern=x[^1-2]) [1] x3 # to remove x1-x3 rm(list=ls(pattern=x[1-2])) More generally, if you want to remove all butx,xx,xxx, you can use

Re: [R] multiple linear regression

2009-08-21 Thread Ronggui Huang
pls use lm(y ~ x1+x2) 2009/8/21 Inchallah Yarab inchallahya...@yahoo.fr: Good morning, I want to make a linear regression of a variable fuction of  two variables y = a1 x1 + a2 x2 + c I found the function lm (y ~ x)  but it used  for a simple linear regression, but for  multiple

Re: [R] Estimate Discrete Choice Models with R

2009-08-15 Thread Ronggui Huang
glm can do probit regression, and glmer (lme4 package) and do mixed effect logit model. Ronggui 2009/8/16 Hongwei Dong pdxd...@gmail.com: Thanks for the replies. What I'm really interest in are the functions that can do GEV, probit, and mixed logit. I searched R, and I did find the function

Re: [R] why summary() does not work here???

2009-08-15 Thread Ronggui Huang
I cannot reproduce what you mentioned. One possible is that you use summary() without loading VGAM package. 2009/8/16 Hongwei Dong pdxd...@gmail.com: Hi, R users,  I'm using the function vglm to estimate a multinomial logit model. Every time I use summary() to ask for the coefficients and std

Re: [R] prop.test() - need algorithm or reference

2009-08-13 Thread Ronggui Huang
The help page of prop.test gives you three references. Isn't it enough? For example, Newcombe R.G. (1998) Two-Sided Confidence Intervals for the Single Proportion: Comparison of Seven Methods. _Statistics in Medicine_ *17*, 857-872. Newcombe R.G. (1998) Interval Estimation

Re: [R] Games in R

2009-08-12 Thread Ronggui Huang
Hi, another package can be found here http://r-forge.r-project.org/projects/fun/ 2009/8/13 Bjørn Arild Mæland bjorn.mael...@gmail.com: Hi, There's a couple of games listed on crantastic: http://crantastic.org/tags/games -Bjorn 2009/8/12 David Croll david.cr...@gmx.ch: Hi everybody -

Re: [R] How to Import Excel file into R 2.9.0 version

2009-08-11 Thread Ronggui Huang
You can download it from http://treetron.googlepages.com/xlsreadwrite.htm Also, you may have a look at Data import/export manual, which has a relevant section. Ronggui 2009/8/11 rajclinasia r...@clinasia.com: Hi Every one, I have a problem with Reading Excel file into R 2.9.0 version. In

Re: [R] RES: Saving plots to file

2009-08-10 Thread Ronggui Huang
Or you can plot first, when you are satisfied with it, copy the plot to another device. for example, X11() plot(rnorm(10)) dev.copy(png) ## copy the plot to an png file. Best 2009/8/11 Rodrigo Aluizio r.alui...@gmail.com: You can save plots as specified below. For details see ?png, ?postscrip,

Re: [R] Example scripts for R Manual

2009-08-10 Thread Ronggui Huang
Is it really necessary? You can just copy the commands in the manual and paste them to R. Ronggui 2009/8/11 Peng Yu pengyu...@gmail.com: Hi, I am wondering if some experienced users would help put the ready-to-run code of the examples in the manuals. It would help new users  learn R faster

Re: [R] import data into R

2009-08-05 Thread Ronggui Huang
You can not import xls file by read.table. You may save xls as csv file, and import it by read.csv. 2009/8/6 Inchallah Yarab inchallahya...@yahoo.fr: Thank you Gabor Grothendieck for your answer !! i have charge the pachage but now i have this massage  read.table(c:/TOTAL.xls,h=T) [1]

Re: [R] Comparison of Output from dwtest and durbin.watson

2009-08-04 Thread Ronggui Huang
I think the statistics are the same, but the p-values are not exactly the same as they used different methods for the p-value. car uses bootstrapping and lmtest uses the pan algorithm, said from the help pages. 2009/8/4 Tom La Bone boo...@gforcecable.com: Allow me to reword this question. I

[R] status of boolean package

2009-08-03 Thread Ronggui Huang
FYI -- Forwarded message -- From: Bear Braumoeller braumoelle...@polisci.osu.edu Date: 2009/8/4 Subject: Re: Package boolean on CRAN To: c...@datanalytics.com c...@datanalytics.com Cc: Ronggui Huang ronggui.hu...@gmail.com, Ben Goodrich goodr...@fas.harvard.edu Gentlemen

Re: [R] Compare lm() to glm(family=poisson)

2009-08-02 Thread Ronggui Huang
In practices, it is not easy to make such decision. One example is size of social ties in social network study. It is very common to use OLS thought it is count variable rather than normal. I think AIC is suggestive as well. Ronggui 2009/8/2 Alain Zuur highs...@highstat.com: Mark Na wrote:

[R] status of boolean?

2009-08-02 Thread Ronggui Huang
package of boolean has been removed from CRAN. Anyone know why? Thanks. -- HUANG Ronggui, Wincent PhD Candidate Dept of Public and Social Administration City University of Hong Kong Home page: http://asrr.r-forge.r-project.org/rghuang.html __

Re: [R] Likelihood Function for Multinomial Logistic Regression and its partial derivatives

2009-08-02 Thread Ronggui Huang
You may refer to mlogit for the ordinary multinomial regression. As fas as I know, there are no functions for multilevel multinomial regression. Ronggui 2009/8/2 nikolay12 nikola...@gmail.com: Hi, I would like to apply the L-BFGS optimization algorithm to compute the MLE of a multilevel

Re: [R] Collinearity in Linear Multiple Regression

2009-08-02 Thread Ronggui Huang
I think perturb:colldiag implementes condition index as well as variance decomposition proportions. Ronggui 2009/7/21 Stephan Kolassa stephan.kola...@gmx.de: Hi Alex, I personally have had more success with the (more complicated) collinearity diagnostics proposed by Belsley, Kuh Welsch in

Re: [R] R book for economists

2009-08-01 Thread Ronggui Huang
How about Kleiber, C. Zeileis, A. Applied Econometrics with R Springer, 2008? Ronggui 2009/8/1 Thiemo Fetzer t...@devmag.net: Dear Group, I am an economics student starting with PhD work in London. As preparation I would like to get to know R a little bit better. For Stata there are tons of

Re: [R] Installing lme4 package in Windows Vista

2009-07-28 Thread Ronggui Huang
After installation of lme4, you need to load it before use it. library(lme4) ?lmer 2009/7/29 Angela Radulescu angela.radule...@gmail.com: Hi all, I have a problem with package installing in Windows, on my PC machine. The end goal is to be able to use the lme() function. Here's what I did so

Re: [R] Error in object$coefficients : $ operator not defined for this S4 class

2009-07-07 Thread Ronggui Huang
What is fit in your example? Ronggui 2009/7/7 aledanda danda.ga...@gmail.com: Hallo, I received this error message while calculating the coefficents coef(fit, matrix=TRUE) Error in object$coefficients : $ operator not defined for this S4 class what is this? How can I solve it? Ale

Re: [R] Error in object$coefficients : $ operator not defined for this S4 class

2009-07-07 Thread Ronggui Huang
/7/7 Alessandra Galli danda.ga...@gmail.com: Sure, sorry, I am fitting with beta distribution: y= rbeta(n - 1000, shape1=exp(0), shape2=exp(1)) fit = vglm (y ~ 1, betaff, trace =TRUE) Thanks 2009/7/7 Ronggui Huang ronggui.hu...@gmail.com What is fit in your example? Ronggui 2009/7/7

Re: [R] Correlation Network Diagram?

2009-07-03 Thread Ronggui Huang
Maybe not address your question directly. There is a package for correlation visualization in r-forge (http://r-forge.r-project.org/projects/corrplot/). 2009/7/3 rory.wins...@gmail.com: Hi all On page 39 of this paper [1] by Andrew Lo there is a very interesting correlation network diagram

Re: [R] save the result into a word file

2009-07-03 Thread Ronggui Huang
How about export it to a HTML and then copy to MS word. I have packaged some code to export lm object to HTML in AJS style. You can have a look at ASAtable (http://r-forge.r-project.org/R/?group_id=328). Ronggui 2009/7/3 Suyan Tian st...@mail.rockefeller.edu: Hi, everyone: I forget on how to

Re: [R] order by decerasing 1st variable and increasing 2nd variable

2009-06-24 Thread Ronggui Huang
How about this: x[order(x$One,-x$Two,decreasing=T),] One Two 8 5 3 7 4 3 6 3 3 4 2 2 5 2 3 3 1 1 1 1 2 2 1 3 2009/6/24 Daniel Brewer daniel.bre...@icr.ac.uk: Hello, I have a data.frame which I would like to sort with the primary key decreasing while the

Re: [R] Urgent - odfWeave produces graphs /images with Read-Error

2009-06-17 Thread Ronggui Huang
If you use lattice to produce the figures, you need to wrap them in print, say, = print(xyplot(y~x,data=dat)) @ Ronggui 2009/6/17 Fredrik Karlsson dargo...@gmail.com: Dear list, I have been working on a report with around 60 images in it, and everything has been fine, until now. I find that

Re: [R] The most straightfoward way to write a function that sums over the rows of a matrix

2009-06-16 Thread Ronggui Huang
Why not just use rowSums? Ronggui 2009/6/16 Stu @ AGS s...@agstechnet.com: Hello! I am trying to write a function with vector and data.frame parameters that uses the sum() function and values from the rows of the data.frame. I need to pass this function as a parameter to optim(). My

[R] How to capture output from a subprocess?

2009-06-13 Thread Ronggui Huang
## open a pipe a - pipe(mplayer -slave -quiet /media/wind/Music/a.mp3,w) write(get_file_name,a) ## send get_file_name command to player. ## ANS_FILENAME='a.mp3' write(quit,a) ## exit mplayer Can I capture the output from mplayer into a R object? In this case, it is ANS_FILENAME='a.mp3'. I try

Re: [R] Install local package

2009-06-11 Thread Ronggui Huang
## Check the package R CMD check path.of.package ## Build the package R CMD build pathof.package ## INSTALL the package R CMD INSTALL path.of.package You can use _R --help _ (from within terminal) to get more information. Ronggui 2009/6/11 Jorge Cornejo cornejo...@gmail.com: Hi, I'm

Re: [R] graphically representing frequency of words in a speech?

2009-06-10 Thread Ronggui Huang
There is a similar discussion in statalist (http://n2.nabble.com/st%3A-Tag-clouds-in-Stata--tt2992551.html#none), I think they make a reasonable argument that tag cloud is not a good statistical graphic. 2009/6/10 Yihui Xie xieyi...@gmail.com: Hi, As Gregor Gorjanc mentioned, it's very

Re: [R] Vista + R = *!!?@

2009-06-10 Thread Ronggui Huang
lmer will not produce p-value but glmer does. So, if you want to estimate a lmm model, you can use lme in nlme package instead. Ronggui 2009/6/11 John Townsend-Mehler towns...@msu.edu: Hello People of R, Is there any way that I can get R to function properly using Vista.  I get very strange

Re: [R] Writing Reports from R in Office Open XML format (ooxmlWeave?)

2009-06-09 Thread Ronggui Huang
Wow, It sounds great. Looking forward to it. 2009/6/9 Duncan Temple Lang dun...@wald.ucdavis.edu: Yes. We will release a version in the next few weeks when I have time to wrap it all up. There is also a Docbook-based version that uses R extensions to Docbook for authoring structured

Re: [R] searchpaths

2009-06-09 Thread Ronggui Huang
No. This function is used to get a list of 'attach'ed _packages_ rather than search files in your computer. 2009/6/10 mau...@alice.it: May I use searchpaths() with arguments partially matching file names that are found in different directories ? My question is whether this is th R function

Re: [R] SECOND MESSAGE: Re: Question about R an SPSS

2009-06-08 Thread Ronggui Huang
There is a technical report on comparison of R and other statistical software (http://www.ats.ucla.edu/stat/technicalreports/Number1/R_relative_statpack.pdf). You can have an overall view from this document. You may have better chance to get answers if you specify what you want to do and if R

Re: [R] RGtk2 help: Show list of column names from dataset and categorize as factor or numeric

2009-06-04 Thread Ronggui Huang
I use gWidgetsRGtk2, which provides widgets such as notebook etc. You can start with gWidgetsRGtk2, and if you want to tailor the GUI according to your needs, you can modified them with RGtk2 package. Ronggui 2009/6/4 Harsh singhal...@gmail.com: Hi UseRs, I recently started working with the

Re: [R] (no subject)

2009-05-31 Thread Ronggui Huang
use _search()_ to see if the package is on the search path. If yes, use _detach(package:sn,unload=TRUE)_ to detach it and then try to install it again. Ronggui 2009/6/1 Roslina Zakaria zrosl...@yahoo.com: Hi R-users, I try to use sn package but it give me the following message:

Re: [R] problem with ls command

2009-05-29 Thread Ronggui Huang
I am not sure what you want. The error msg is clear to me. You can use search() to search what are in the search path, for example. search() [1] .GlobalEnvpackage:stats package:graphics [4] package:grDevices package:utils package:datasets [7] package:methods Autoloads

Re: [R] GTK Tooltips under Linux

2009-05-29 Thread Ronggui Huang
Noted with thanks. Regards Ronggui 2009/5/29 Michael Lawrence mflaw...@fhcrc.org: On Thu, May 28, 2009 at 7:35 PM, Ronggui Huang ronggui.hu...@gmail.com wrote: Dear all, I want to set tool-tips for a gtkButton. I use the following code which works under Windows. However, it doesn't

[R] GTK Tooltips under Linux

2009-05-28 Thread Ronggui Huang
Dear all, I want to set tool-tips for a gtkButton. I use the following code which works under Windows. However, it doesn't work under Linux. Any hints? Thanks. library(RGtk2) b-gtkButtonNewWithLabel(OK) gtkTooltips()$setTip(b,Memo for a Button.) gw - gtkWindow(show=F) gw$Add(b) gw$Show()

Re: [R] R under Ubuntu

2009-05-26 Thread Ronggui Huang
I think it is standard practice. If you want R to load a workspace automatically when R is launched, you can add the command in .Rprofile. See ?Startup for more on Initialization at Start of an R Session. Ronggui 2009/5/26 Luis Ridao Cruz lu...@hav.fo: R-help, I have installed R under Ubuntu

Re: [R] split strings

2009-05-26 Thread Ronggui Huang
They look like file path, so you can make use of basename() first, then use gsub to strip the suffix. x-c(F:/Naval_Live_Oaks/2005/data//BE.tif,F:/Naval_Live_Oaks/2005/data//CH.tif) x2-sapply(x,basename,USE.NAMES=FALSE) gsub([.].{1,}$,,x2) [1] BE CH Ronggui 2009/5/26 Monica Pisica

Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-25 Thread Ronggui Huang
at 8:27 AM, Ronggui Huang ronggui.hu...@gmail.com wrote: Thanks, Michael. Just one more follow-up question. Is there other way to get the GdkDrawable (here da2) without using - or other assignment operation from within expose_fn? I thought da$GetRootWindow() would work, but it does not. You

[R] Draw a rectangle on top of an image using RGtk2?

2009-05-23 Thread Ronggui Huang
Dear all, I use gtkImageFromFile to display an image. Then I want to do some gsignal to handle mouse event. I click the mouse and move a another position and release. I can get the position of the firs click and the release position, then I would to draw a rectangle to display the region I have

Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-23 Thread Ronggui Huang
, May 22, 2009 at 11:27 PM, Ronggui Huang ronggui.hu...@gmail.com wrote: Dear all, I use gtkImageFromFile to display an image. Then I want to do some gsignal to handle mouse event. I click the mouse and move a another position and release. I can get the position of the firs click

Re: [R] Trouble installing package 'systemfit'

2009-05-20 Thread Ronggui Huang
Have you tried another mirror? It seems that downloaded file is incomplete. 2009/5/20 Rui Wang r...@hawaii.edu: I tried unnder R 2.9.0 and R 2.8.1. Both versions failed to install 'systemfit'. I downloaded file 'systemfit_1[1].0-8.zip' to install the package. I am using Windows 2000 service

Re: [R] Remove objects names like character String

2009-05-19 Thread Ronggui Huang
I don't get the error you mention: site1_data-1 site2_data-2 site3_data-3 for (i in 1:3) paste(site,i,_data,sep=) In my example, another way is: rm(list=paste(site,1:3,_data,sep=)) Or you can use rm(list=ls(pattern=you pattern)), in my example, it is: rm(list=ls(pattern=site[1-3]_data))