[R] how to put barchart and line chart in the same plot in ggplot2

2012-08-04 Thread xin wei
dear userR: I am trying to plot two dependent variables in the same plot in ggplot2. because these two variables have very different magnitude, I have to use a second Y axis. I hope one variable to be line and the other to be barchart. The x axis is continuous. Yet since I have to make barchart, I

[R] statistical model with censored independent variable

2011-06-12 Thread xin wei
hello: Does anyone know any R function which handles statisitcal model when the independent variable is censored? I know survival package does the analysis for censored dependnent variable. thanks -- View this message in context:

Re: [R] how to add row index based a categorical column

2011-05-31 Thread xin wei
thank you everyone. how can I not be aware of the existence of ave()? I try the following: tapply(data$value, data$level, rank). However, I have a very difficult time merging the resulting rank variable back to the original data frame. thanks a lot! -- View this message in context:

[R] how to add row index based a categorical column

2011-05-27 Thread xin wei
hello, I have the following data manipulation issue. the following is the sample data: value level 4 A 5 A 2 A 10 B 9 B 34 B 100 C 34 C 101C. I hope to get the following result: value level rank 2 A 1 4 A 2 5 A 3 9

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-16 Thread xin wei
Dear Gabor: I did not have time to look at this issue these few days. Now I saw your investigation. I am very grateful that you quickly identify the root cause of this. It seems that a little caution needs to be exercised when applying sqldf to text file with large number of blanks (I have no

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-02 Thread xin wei
I am sorry for posting the wrong source file. the correct source file is as follows: a b c aa 23 aaa 34.6 77.8 They are tab delimited but somehow could not be displayed correctly in browser. -- View this message in context:

Re: [R] a question on sqldf's handling of missing value and factor

2011-03-02 Thread xin wei
Dear Mr. Grothendieck : thank you so much for your attention. You are the real expert here. the following is a mock text file: a b c aa 23 aaa 34 77 note that both b and c column contain missing value (blank) I save it under my C drive and use

[R] a question on sqldf's handling of missing value and factor

2011-03-01 Thread xin wei
Dear subscribers: I am using the following code to read a large number of big text files: library(sqldf) tempd - file() tempdx - sqldf(select * from tempd, dbname = tempfile(), file.format = list(header = T, sep=\t, row.names = F)) The problem is: all my numberical variable become factor

Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-25 Thread xin wei
(programming_language) where the nice Mandelbrot plot and sample codes are provided. i would appreciate your help if you can provide further hint. thanks Peter Dalgaard-2 wrote: On 09/24/2010 10:41 PM, xin wei wrote: I am trying to reproduce the nice looking of Mandelbrot demonstrated

[R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-24 Thread xin wei
I am trying to reproduce the nice looking of Mandelbrot demonstrated by R wiki page by the following code: library(caTools)# external package providing write.gif function jet.colors = colorRampPalette(c(#7F, blue, #007FFF, cyan, #7FFF7F, yellow,

Re: [R] how to generate a random data from a empirical distribition

2010-07-28 Thread xin wei
hi, Frank: how can we make sure the randomly sampled data follow the same distribution as the original dataset? i assume each data point has the same prabability to be selected in a simple random sampling scheme. thanks -- View this message in context:

Re: [R] how to generate a random data from a empirical distribition

2010-07-27 Thread xin wei
hi, Dennis: points well taken. it seems to be important to investigate the nature of distribution. I may be too naive to assume a empirical probability distribution would be computed from a could of data points -- View this message in context:

Re: [R] how to generate a random data from a empirical distribition

2010-07-27 Thread xin wei
good point. It seems to be important to investigate the nature of distribution. I might be too naive to assume that a empirical probability distribution would be automatically generated from a cloud of data points. -- View this message in context:

Re: [R] how to generate a random data from a empirical distribition

2010-07-27 Thread xin wei
this is very insightful. sounds exactly like what I want to do. thanks. Frank. -- View this message in context: http://r.789695.n4.nabble.com/how-to-generate-a-random-data-from-a-empirical-distribition-tp2302716p2304346.html Sent from the R help mailing list archive at Nabble.com.

[R] how to generate a random data from a empirical distribition

2010-07-26 Thread xin wei
hi, this is more a statistical question than a R question. but I do want to know how to implement this in R. I have 10,000 data points. Is there any way to generate a empirical probablity distribution from it (the problem is that I do not know what exactly this distribution follows, normal,

Re: [R] help with reshape is needed again!

2010-06-19 Thread xin wei
thank you very much for such a thorough solution! -- View this message in context: http://r.789695.n4.nabble.com/help-with-reshape-is-needed-again-tp2260640p2260943.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] help with reshape is needed again!

2010-06-18 Thread xin wei
hi, folks: i need to transpose the following data: genetissuepatient1 patient2 patient3. - gene1 breast 10100 1 gene2 breast 20200 4 gene3 breast 3050

[R] help for reshape function

2010-06-17 Thread xin wei
hi, everyone: i have a question on the reshape function. i have the following dataset : gene tissuepatient1 patient2 patient3. _ gene1 breast 10 20 50 gene2 breast 20 40 60 gene3

Re: [R] help for reshape function

2010-06-17 Thread xin wei
I am afraid that your solution is not solving the problem. it seems that timevar=gene just create the followings: GENESAMPLE value id 1.11 Kidney 3.69351 1 2.11 Kidney 5.42710 2 3.11 Kidney 5.26883 3 4.11 Kidney 2.88098 4 5.11 Kidney 4.68519

[R] how to parse out string separated by special character

2010-06-07 Thread xin wei
hi, everyone: i have a data frame with one single character column as followings: DS_xxx_yyy_24hr_zzz_1 DS_xxx_yyy_24hr_zzz_2 DS_xxx_yyy_24hr_zzz_3 DS_xxx_yyy_24hr_zzz_4 DS_xxx_yyy_24hr_zzz_1 DS_xxx_yyy_24hr_zzz_2 DS_xxx_yyy_24hr_zzz_3 DS_xxx_yyy_24hr_zzz_4 DS_xxx_yyy_24hr_zzz_1 i need to parse

[R] what the problem could be if i am suddenly unable to add abline to the scatter plot?

2010-05-12 Thread xin wei
I am doing very regular stuff like the following: attach(wtana) fm- lm(Body.Wt.on.SD1~Heart.Wt, data=wtana) #fm- lm(wtana$Body.Wt.on.SD1~wtana$Heart.Wt) lrf- loess(Body.Wt.on.SD1~Heart.Wt, wtana) #lrf- loess(wtana$Body.Wt.on.SD1~wtana$Heart.Wt) plot(Body.Wt.on.SD1,Heart.Wt)

Re: [R] how to make R plot under Linux

2010-02-22 Thread xin wei
thank you for reply. I just type: hist(x) from SSH terminal, expecting a histogram to pop up like what i got under windows.instead I got the following error msg: Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype, : unable to start device X11cairo In addition:

Re: [R] how to make R plot under Linux

2010-02-22 Thread xin wei
hi, Kevin and K.Elo: thank you for the suggestion. Can you be more specific on these? (like how exactly get into x-switch or man ssh). I am totally ignorant about linux and SSH:( Memory limitation forces me to switch from windows to Linux cluster. Xin -- View this message in

Re: [R] how to make R plot under Linux

2010-02-22 Thread xin wei
hi, Guys: thank you so much for all the suggestion. Now I seem to be able to set up x11 forwarding in PUTTY. however, I still could not get plot and I get the following error msg: Error in function (display = , width, height, pointsize, gamma, bg, : X11 I/O error while opening X11 connection