Re: [R] how to get the numbers of factors in a matrix

2014-01-21 Thread Liu , Jun Yi
Dear YZ, I guess this is what you want: 1. http://stackoverflow.com/questions/3418128/how-to-convert-a-factor-to-an-integer-numeric-without-a-loss-of-information 2.  http://stackoverflow.com/questions/6979625/arithmetic-operations-on-r-factors/6980780#6980780 3. 

[R] clust algorithm for interval-typed data

2013-07-22 Thread Cheng, Yi
Hi: I am looking for clust algorithms for interval-typed data. (for example, the session data with start time and end time). I can't find it. Please help to point me to any existing. Cheng Yi [[alternative HTML version deleted]] __ R-help

[R] about mix type clust algorithm

2013-07-22 Thread Cheng, Yi
bigger say 10,000 rows of data, the dissimilarity matrix will be O(n^2), and out of memory will occur. I am wondering is there any better ways to do the mixed type cluster? Cheng Yi [[alternative HTML version deleted]] __ R-help@r-project.org

[R] How to use SparseM-conversions to convert a dCgMatrix into a matrix.csr ?

2013-05-07 Thread Yi Yuan
Hi all, I want to transform a dCgMatrix from package Matrix into a matrix.csr from package SparseM, and I found out this link : http://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/SparseM-conv.html But there's no informaion about usage/description/arguments, so how do I use this

[R] a huge sparse matrix to pass into svm

2013-05-06 Thread Yi Yuan
Hi all, I have a huge sparse matrix, it's 360K*210K. Right now I have all the nonzero elements and their indices, so I want to transform this information into a sparse matrix so that I could pass the sparse matrix into svm function. I was planning to use sparse_matrix-

Re: [R] R doesn't recognize utils functions, such as arrayIndex( )

2013-04-02 Thread Yi Yuan
marks, so I thought the name must be just utils. On Tue, Apr 2, 2013 at 9:16 AM, Sarah Goslee sarah.gos...@gmail.com wrote: Why do you think the utils package and the R.utils package are the same thing? Sarah On Tuesday, April 2, 2013, Yi Yuan wrote: Hi all, When I called arrayIndex

[R] R doesn't recognize utils functions, such as arrayIndex( )

2013-04-02 Thread Yi Yuan
Hi all, When I called arrayIndex(20:23, dim=c(4,3,3)), it says Error: could not find function arrayIndexin R. So I called ls(package:utils) to see the functions inside: [1] ? [2] adist [3] alarm [4] apropos [5] aregexec [6] argsAnywhere [7] arrangeWindows [8] as.person I'm only

[R] ggplot2: less than equal sign

2013-03-28 Thread soon yi
Hi I am trying to add a less than equal sign to a plot. I have previously done this using unicode but is not working in this instance. Any suggestions would be great thanks example code: library(ggplot2) df-data.frame(vis=c(0,0,1,1) , count=c(10,15,20,10) , grp=c(0,1,0,1)) df$grp

Re: [R] ggplot2: less than equal sign

2013-03-28 Thread soon yi
of code. To change the axis and legend titles, one can use the labs() function; e.g., last_plot() + labs(x = Visibility, y = Frequency, fill = Threshold) Dennis On Thu, Mar 28, 2013 at 2:22 PM, soon yi lt; soon.yi@ gt; wrote: Hi I am trying to add a less than equal sign to a plot. I

Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread soon yi
or just levels(df$y)[5:7]-others Ista Zahn wrote Hi Lorenzo, On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella lt; lorenzo.isella@ gt; wrote: Dear All, Probably something very easy, but I am looking for the most efficient ways to achieve this. Consider the following snippet

Re: [R] Ordering a matrix by row value in R2.15

2013-03-24 Thread soon yi
or this with Pete's example orig[,order(orig[2,])] Pete Brecknock wrote fitz_ra wrote I know this is posted a lot, I've been through about 40 messages reading how to do this so let me apologize in advance because I can't get this operation to work unlike the many examples shown. I

Re: [R] Combining boxplot

2013-02-25 Thread soon yi
does this work for you? df1 = data.frame(x = rnorm(100)) df1$type = ifelse(df1$x = 0 , type1, type2) df1$group-1 df2 = data.frame(x = rnorm(50,0,2)) df2$type = ifelse(df2$x = 0 , type1, type2) df2$group-2 combined.df-rbind(df1,df2) boxplot(combined.df$x ~ combined.df$group

Re: [R] How can I plot graphs together?

2013-02-15 Thread soon yi
look at dev.new() to specify plot window size and then ?layout to specify number and size of each plot in the window Jiaqi.Zhang wrote Hi, all, I am working on the following code to learn how to plot graphs together. I used the par(mfrow=c(1,3)) function to try to put all three plot()

Re: [R] Why replacement has length zero? And How can I fix it?

2013-02-02 Thread soon yi
Hi for the loop section runif needs curved brackets Try IAP -NA for (i in 1:Sample.Size){ if (DataSet$SES[i]0) { IAP[i] - ifelse(runif(1)0.75, 1, 0) # High SES, higher chance to be in Treatment # } else { IAP[i] -

[R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
I installed jpeg package and tried to use kim-readJPEG(kim.jpeg) to read in a jpeg file, but R gave me an error: Error in readJPEG(kim.jpeg) : unable to open kim.jpeg I already put kim.jpeg in Rstudio's default working directory: E:\home work\Rstudio. So I don't think it's a problem caused by

[R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
Hi, r-help mailing list subscribers, I installed jpeg package and tried to use kim-readJPEG(kim.jpeg) to read in a jpeg file, but R gave me an error: Error in readJPEG(kim.jpeg) : unable to open kim.jpeg I already put kim.jpeg in Rstudio's default working directory: E:\home work\Rstudio. So I

Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Newmiller Sent: Monday, January 14, 2013 8:25 AM To: Yi Yuan; r-help@r-project.org Subject: Re: [R] readJPEG function cannot open jpeg files Being unable to open a file

Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Yi Yuan
Hi, guys, my problem is solved. I used file.info(list.files(getwd(),full.names=TRUE)) and found out that the said file is listed as kim.jpg instead of kim.jpeg. So kim-readJPEG(kim.jpg) worked. Thanks for your help and sorry for my newbie question. On Mon, Jan 14, 2013 at 11:59 AM, Yi Yuan

[R] table of list objects

2013-01-03 Thread soon yi
Hi I have a list such as this list(c(q,w),r,c(r,w),c(q,w)) How do i create a table to include the count of groups of terms please? ie so output is like / similar to q,wr r,w 211 thanks for any help -- View this message in context:

Re: [R] table of list objects

2013-01-03 Thread soon yi
perfect. thanks for the quick reply soon yi wrote Hi I have a list such as this list(c(q,w),r,c(r,w),c(q,w)) How do i create a table to include the count of groups of terms please? ie so output is like / similar to q,wr r,w 211 thanks

[R] ggplot geom_smooth colour

2012-12-17 Thread soon yi
Hi I am using geom_smooth to fit linear regression lines over a scatterplot for two treatment groups. The default colour for the two lines are blue. I have been unable to change this with the usual options. A search online has not suggested any solution / work around. Is there a solution to

Re: [R] ggplot geom_smooth colour

2012-12-17 Thread soon yi
. Adding colour=black into the geom_smooth aesthetic does not change the line colour to black. thanks, sy soon yi wrote Hi I am using geom_smooth to fit linear regression lines over a scatterplot for two treatment groups. The default colour for the two lines are blue. I have been unable

Re: [R] ggplot geom_smooth colour

2012-12-17 Thread soon yi
Thank you. Rather embarrassed. Its fair to say i had rather over comlicated my attempts to do this. sy soon yi wrote Hi I am using geom_smooth to fit linear regression lines over a scatterplot for two treatment groups. The default colour for the two lines are blue. I have been unable

[R] ggplot - adding regression lines

2012-12-12 Thread soon yi
Hi I am using ggplot to overlay two regression lines on a scatter plot each corresponding to a treatment group. The default plot gives a different slope for each treatment group. However, in some cases i want the lines to be parallel -ie no significant interaction. My code:

Re: [R] update fit (removing insignificant variables)

2012-11-21 Thread soon yi
170 predictors - perhaps try lasso regression -- View this message in context: http://r.789695.n4.nabble.com/Re-update-fit-removing-insignificant-variables-tp4650379p4650394.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread soon yi
#Data df-data.frame(id=letters[1:10],var1=rnorm(10,10,5),var2=rnorm(10,5,2),var3=rnorm(10,1,1)) #Missing df$var1[2]-df$var2[c(2,6)]-df$var3[c(2,5)]-NA na.replace-seq(1:ncol(df))-1 df[,names(df)]-sapply(1:dim(df)[2], function(ii) {ifelse(is.na(df[,ii]),na.replace[ii],df[,ii])} ) David

[R] structural equations using sem package

2012-11-05 Thread Soon Yi
Hello I am using sem to look at the direct effect of one variable on another but i am uncertain if i am progressing correctly. An example: covar1-  matrix(c(0.4,-0.2,3,-0.2 , 0.3,-2 , 3 ,-2 , 60), nrow=3,byrow=T) rownames(covar1)-colnames(covar1)-c(endo,exo,med) path1-matrix(c(    exo -

[R] (no subject)

2012-10-04 Thread Chia-Yi Chiu
Hi I would like to learn how the R function hclust deals with ties. It is written in Fortran, so I cannot access the code. Thanks!! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] help on plotfit function in package nlstools

2012-09-12 Thread Yi Li
I encountered this problem when I was learning nonlinear regression with R : there is this function plotfit in package nlstools,which displays a superimposed plot of the dependent variable versus one the independent variables together with the fitted model.,but when I execute the example given in

[R] Help on calculating spearman rank correlation for a data frame with conditions

2012-08-28 Thread Yi
Dear all, Suppose my data frame is as follows: id price distance 1 2 4 1 35 ... 2 4 8 2 5 9 ... n 3 7 n 8 9 I would like to calculate the rank-order correlation between price and distance for each id. cor(price,distance,method = spearman) calculate a correlation for

[R] yi sent you a movie ticket redeemable at more than 200 nation wide theatre chains

2011-03-18 Thread yi
yi has chosen to send you a free movie ticket, up to $10 value. Sit back, relax, and enjoy! In an effort to spread the word about our great products we are allowing our members to send free movie tickets to their selected friends at no charge to our members. This time yi chose you! To redeem

[R] yi sent you a movie ticket redeemable at more than 200 nation wide theatre chains

2011-03-18 Thread yi
yi has chosen to send you a free movie ticket, up to $10 value. Sit back, relax, and enjoy! In an effort to spread the word about our great products we are allowing our members to send free movie tickets to their selected friends at no charge to our members. This time yi chose you! To redeem

Re: [R] Find and replace all the elements in a data frame

2011-02-17 Thread Gong-Yi Liao
/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. -- Gong-Yi Liao Department of Statistics University of Connecticut 215 Glenbrook Road U4120 Storrs, CT 06269-4120 860

Re: [R] Revolution Analytics reading SAS datasets

2011-02-11 Thread Gong-Yi Liao
. Could somebody show me how to import/export SAS datasets. Thanks. -- Gong-Yi Liao Department of Statistics University of Connecticut 215 Glenbrook Road U4120 Storrs, CT 06269-4120 860-486-9478 __ R-help@r-project.org mailing list https

Re: [R] goto blas related R segfault

2011-02-08 Thread Gong-Yi Liao
]] __ 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. -- Gong-Yi Liao

[R] different results in MASS's mca and SAS's corresp

2011-02-04 Thread Gong-Yi Liao
Is MASS's mca developed with different definition to SAS's corresp ? Thank you for any comments! -- Gong-Yi Liao Department of Statistics University of Connecticut 215 Glenbrook Road U4120 Storrs, CT 06269-4120 860-486-9478

[R] using Statistics::R

2010-12-11 Thread Yi-Fang Liu
Hi,ALL I want to use R in Perl, the Statistics::R module is great but I meet the problem: I don`g know how to pass one array from Perl to R, can anyone show me? Any suggestion will be appreciate~ Thank you! [[alternative HTML version deleted]]

Re: [R] previous business day

2010-10-22 Thread Li, Jing Yi
yes. do you know the name of related functions in the timeDate package? Thanks! -Original Message- From: David Reiner [mailto:david.rei...@xrtrading.com] Sent: Friday, October 22, 2010 10:10 AM To: Li, Jing Yi; David Winsemius Cc: r-help@r-project.org Subject: RE: [R] previous business

Re: [R] previous business day

2010-10-22 Thread Li, Jing Yi
Great. Thanks a lot! Please follow the attached hyperlink to an important disclosure: http://www.credit-suisse.com/legal/marketcommentary -Original Message- From: David Reiner [mailto:david.rei...@xrtrading.com] Sent: Friday, October 22, 2010 11:59 AM To: Li, Jing Yi Cc: r-help@r

Re: [R] previous business day

2010-10-22 Thread Li, Jing Yi
Thanks for the info! -Original Message- From: David Scott [mailto:d.sc...@auckland.ac.nz] Sent: Friday, October 22, 2010 4:19 PM To: David Reiner Cc: Li, Jing Yi; r-help@r-project.org Subject: Re: [R] previous business day On 23/10/2010 4:59 a.m., David Reiner wrote: Look

[R] previous business day

2010-10-21 Thread Li, Jing Yi
How to get the previous business day in R? I saw some post about using functions in timeSeries package before but can not find it anymore. Thanks! === Please access the attached hyperlink for an important

Re: [R] previous business day

2010-10-21 Thread Li, Jing Yi
: Thursday, October 21, 2010 4:16 PM To: Henrique Dallazuanna Cc: Li, Jing Yi; r-help@r-project.org Subject: Re: [R] previous business day May also wish to or in a check for holidays. -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET

Re: [R] previous business day

2010-10-21 Thread Li, Jing Yi
, 2010 4:34 PM To: Li, Jing Yi Cc: Clint Bowman; Henrique Dallazuanna; r-help@r-project.org Subject: Re: [R] previous business day On Oct 21, 2010, at 4:20 PM, Li, Jing Yi wrote: Yeah, thanks Henrique for the code. It works! But I also have the questions for the holidays. require(tis

[R] append rows to Sybase datatable using RJDBC

2010-10-12 Thread Li, Jing Yi
Hi, Does anyone have experience using RJDBC library to write to Sybase datatable? The jdbc driver I am using is jConnect 6.0. I can successfully write into a new datatable, but have problem appending rows to existing one. It either complains Table *** already exists or simply overwrite the

Re: [R] append rows to Sybase datatable using RJDBC

2010-10-12 Thread Li, Jing Yi
yes. c(T,F) does return [1] TRUE FALSE -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Tuesday, October 12, 2010 10:00 AM To: Li, Jing Yi Cc: r-help@r-project.org Subject: Re: [R] append rows to Sybase datatable using RJDBC On Oct 12, 2010, at 9:51 AM

[R] append rows to Sybase datatable using RJDBC function dbWriteTable

2010-10-08 Thread Li, Jing Yi
Does anyone have experience using RJDBC library to write to Sybase datatable? The jdbc driver I am using is jConnect 6.0. I can successfully write into a new datatable, but have problem appending rows to existing one. It either complains Table *** already exists or simply overwrite the existing

[R] Variation of predictor of linear model

2010-09-27 Thread Yi Du
Hi folks, I use lm to run regression and I don't know how to predict dependent variable based on the model. I used predict.lm(model, newdata=80), but it gave me warnings. Also, how can I get the variance of dependent variable based on model. Thanks. [[alternative HTML version deleted]]

Re: [R] Variation of predictor of linear model

2010-09-27 Thread Yi Du
variance, ___ ? Cheers, Josh On Mon, Sep 27, 2010 at 12:58 PM, Yi Du abraham...@gmail.com wrote: Hi folks, I use lm to run regression and I don't know how to predict dependent variable based on the model. I used predict.lm(model, newdata=80), but it gave me warnings. Also

Re: [R] How to generate integers from uniform distribution with fixed mean

2010-09-04 Thread Yi
...@lancaster.ac.uk wrote: On Thu, Sep 2, 2010 at 7:17 AM, Yi liuyi.fe...@gmail.com wrote: Hi, folks, runif (n,min,max) is the typical code for generate R.V from uniform dist. But what if we need to fix the mean as 20, and we want the values to be integers only? It's not clear what you want

[R] How to generate integers from uniform distribution with fixed mean

2010-09-02 Thread Yi
Hi, folks, runif (n,min,max) is the typical code for generate R.V from uniform dist. But what if we need to fix the mean as 20, and we want the values to be integers only? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] How to calculate the concentration

2010-08-12 Thread Yi
fruit apple 2 0.722 5 fruit apple 3 0.722 6 fruit orange 1 0.722 HTH, Dennis On Wed, Aug 11, 2010 at 3:40 PM, Yi liuyi.fe...@gmail.com wrote: Thank you for reminding me. ## food=c('fruit','fruit','fruit','drink','drink','drink') type=c('apple','apple

[R] How to calculate the concentration

2010-08-11 Thread Yi
Hi, folks, ## food=c('fruit','fruit','fruit','drink','drink','drink') type=c('apple','apple','orange','water','soda','soda') value=c(2,3,1,5,7,6) data=data.frame(food,type,value) share=c((2+3)/(2+3+1),5/6,1/6,5/(5+7+6),13/18,13/18)

Re: [R] How to calculate the concentration

2010-08-11 Thread Yi
. share_apple=(2+3)/(2+3+1)=5/6 ## It is the same for the two rows share_organge=1/6 concentration_fruit= share_apple^2+sjare_orange^2=(5/6)^2+(1/6)^2 Hope this makes it easier to understand. Thanks Yi On Wed, Aug 11, 2010 at 3:33 PM, Wu Gong w...@mtmail.mtsu.edu wrote: Hi Yi, It would be helpful

[R] plot the dependent variable against one of the predictors with other predictors as constant

2010-08-07 Thread Yi
the prediction of z with the new data.frame but there should be a better way. Thanks all. Yi [[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

[R] How to generate variance of a new observation based on a linear regression model

2010-07-26 Thread Yi
be much larger than the values from se.fit=T. The reason why I need to know the estimations of expectation and also variance is that Y=ln(Z) and I need to know the expectation of Z. Thanks Yi [[alternative HTML version deleted]] __ R-help@r

[R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
of Residual standard error from summary(lin)? Answer to either question will be appreciated! Thanks Yi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
Sorry, for the second question. I stated in a wrong way. My aim is the mean and sd of each new observation. # mean=fitted(prediction) ## But I do not know how to get sd for each new observation. Any tips? Thanks Yi On Wed, Jul 21, 2010 at 2:29 PM, Yi liuyi.fe...@gmail.com wrote

Re: [R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
[log(Y|X*)]. Thanks. On Wed, Jul 21, 2010 at 3:44 PM, Dennis Murphy djmu...@gmail.com wrote: Hi: On Wed, Jul 21, 2010 at 2:29 PM, Yi liuyi.fe...@gmail.com wrote: Hi, folks, Here are the codes: ## y=1:10 x=c(1:9,1) lin=lm(log(y)~x) ### log(y) is following Normal

[R] How to quick check two rows are the same?

2010-07-07 Thread Yi
Hi, folks, Suppose the data is as follows: ### x=1:10 y=2:11 z=3:12 data1=data.frame(x,y) data2=data.frame(x,z) ## In real case, how to check data1$x and data2$x are the same or not? I am using for-loop to do this. Is there a quicker way? Thanks! Yi [[alternative HTML

[R] how to save summary(lm) and anova (lm) in format?

2010-07-02 Thread Yi
‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7181 on 8 degrees of freedom Multiple R-squared: 0.3753, Adjusted R-squared: 0.2972 F-statistic: 4.807 on 1 and 8 DF, p-value: 0.0597 How can I get the exact ouput as shown in R but not as the above? Thanks. Yi

Re: [R] how to save summary(lm) and anova (lm) in format?

2010-07-02 Thread Yi
Hi, I attached a picture to compare the 'mess' to what I what. Maybe there is difference between computers? Thanks. On Fri, Jul 2, 2010 at 10:52 AM, David Winsemius dwinsem...@comcast.netwrote: On Jul 2, 2010, at 1:34 PM, Yi wrote: Hi, folks, I would like to copy the output of summary

[R] How to delete the replicate rows by summing up the numeric columns

2010-06-29 Thread Yi
Hi, folks, I am sorry that I did not state the problem correctly yesterday. Please let me address the problem by the following codes: first=c('u','b','e','k','j','c','u','f','c','e') second=c('usa','Brazil','England','Korea','Japan','China','usa','France','China','England') third=1:10

Re: [R] How to delete rows based on replicate values in one column with some extra calcuation

2010-06-29 Thread Yi
Because I do not think 'aggregate' can not set z as a list and at the same time keep x and y for z. Any tips? I mean my way is too 'silly'. Thanks all in advance! Yi On Mon, Jun 28, 2010 at 7:58 PM, Nikhil Kaza nikhil.l...@gmail.com wrote: aggregate(data$third, by=list(data$first), sum

Re: [R] How to delete the replicate rows by summing up the numeric columns

2010-06-29 Thread Yi
result. HTH, Dennis On Tue, Jun 29, 2010 at 12:05 PM, Yi liuyi.fe...@gmail.com wrote: Hi, folks, I am sorry that I did not state the problem correctly yesterday. Please let me address the problem by the following codes: first=c('u','b','e','k','j','c','u','f','c','e') second=c('usa

[R] How to delete rows based on replicate values in one column with some extra calcuation

2010-06-28 Thread Yi
third 8 Thanks in advance. Yi [[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

[R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Yi
Hi, folks, Finally Friday~~ Here comes the question: x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to

[R] All a column to a data frame with a specific condition

2010-06-25 Thread Yi
Hi, folks, Please first look at the codes: plan_a=c('apple','orange','apple','apple','pear','bread') plan_b=c('bread','bread','orange','bread','bread','yogurt') value=1:6 data=data.frame(plan_a,plan_b,value) library(plyr) library(reshape) mm=melt(data, id=c('plan_a','plan_b'))

[R] how to change the format of numeric variable

2010-06-24 Thread Yi
(1e+03, 5e+3). I would like all the data in the digit format (1000, 5000). Does any function works for this? Big thanks Yi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] count data with a specific range

2010-06-23 Thread Yi
x3 -10-02 5 1 (# points in this range) 0-10 7 9 6 ... I know the table function but I do not know how to deal with the range issue. Thanks in advance. Yi [[alternative HTML

[R] Verify the linear regression model used in R ( fundamental theory)

2010-06-22 Thread Yi
and the model used for rlm. Thanks Yi [[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

[R] How to 'understand' R functions besides reading R codes

2010-06-22 Thread Yi
to figure out how R function works and what is the underlying theory besides looking at the codes (type var or lm at the Rprompt). Because R codes are too difficult to understand. Thanks Yi [[alternative HTML version deleted]] __ R-help@r

[R] How to predict the mean and variance of the dependent variable after regression

2010-06-21 Thread Yi
Hi, folks, As seen in the following codes: x1=rlnorm(10) x2=rlnorm(10,mean=2) y=rlnorm(10,mean=10)### Fake dataset linmod=lm(log(y)~log(x1)+log(x2)) After the regression, I would like to know the mean of y. Since log(y) is normal and y is lognormal, I need to know the mean and variance of

[R] How to calculate the robust standard error of the dependent variable

2010-06-18 Thread YI LIU
Hi, folks linmod=y~x+z summary(linmod) The summary of linmod shows the standard error of the coefficients. How can we get the sd of y and the robust standard errors in R? Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Read data from .csv file and regression on dummy variables

2010-06-18 Thread YI LIU
Hi, I need to regress the population on time slot and also days in advance. A sample dataset is like this. I do not know whether I can attach a file in this mailing list or not. If you know how to do it, I will be happy to send you my data file. time slot days in advance US EUR

[R] Read data from .csv file and regression on dummy variables

2010-06-18 Thread YI LIU
Hi, I need to regress the population on time slot and also days in advance. A sample dataset is like this. I do not know whether I can attach a file in this mailing list or not. If you know how to do it, I will be happy to send you my data file. time slot days in advance US EUR

[R] How to read data from this csv?

2010-06-18 Thread YI LIU
I am so frustrated about reading data from this sample csv file. My code is : test=read.csv(file='test.csv',header=T) warning message: In read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'test.csv' test [1] ÐÏ.à.. 0 rows

[R] how to 'average' one col wrt to another one

2010-06-16 Thread YI LIU
Hi, folks, test=matrix(rep(letters[1:3],6),nrow=6,byrow=T) test[2,]=letters[5:7] test[4,]=c('e','f','i') test[1,3]='i' colnames(test)=c('leave','arrive','line') The code will generate a sample dataset. I have thousands rows of data. For the same 'leave' and 'arrive', how can I get the sum of

[R] how to make JAVA available for R use?

2010-06-15 Thread yi li
i've just installed the packagexlsx,which is used for read,write,format Excel 2007 files, as i loaded the package ,i was told to intall the package rJava, the problem was that i didn't have a JAVA platform on my computer, so i have to install JAVA JDK first, my problem is ,after i 've installed

Re: [R] simultaneous plots

2010-04-06 Thread Yi Du
Hi Alex, You can try to use: par(new=TRUE) to draw the two graphs together. But keep in mind that the scale of x axis of both graphs is using the same level. Otherwise, the graph would be messed up. Yi On Tue, Apr 6, 2010 at 6:16 PM, Alexandre Serra Barreto fcicl...@bol.com.br wrote

[R] Estimate ARMA model with MLE

2010-03-01 Thread Yi Du
Hi there, I want to fit a ARMA model with the method of MLE. Is there any package that could implement this method? Thanks, Yi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Estimate ARMA model with MLE

2010-03-01 Thread Yi Du
that? Thanks, Yi On Mon, Mar 1, 2010 at 11:26 AM, Owe Jessen owe.jes...@gmx.de wrote: Did you have a look at the package arima? HTH Owe Hi there, I want to fit a ARMA model with the method of MLE. Is there any package that could implement this method? Thanks, Yi

[R] Legend's attribute

2010-02-25 Thread Yi Du
) to draw a horizontal line and I also want to show 0.08 in the y-axis, how can I do it? Many thanks, Yi -- Yi Du Ph. D student in Economics University of Missouri Department of Economics 118 Professional Building Columbia MO 65211 1-573-239-6467 [[alternative HTML version deleted

[R] Ask about drawing kernel density estimation

2010-01-21 Thread Yi Du
of kernelplot, But I still don't know how to draw the four years kernel in one graph. Also, I don't need the rug(age) in kernelplot, how can I delete it? Thanks. -- Yi Du [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Ask for histogram

2010-01-13 Thread Yi Du
where I did wrong. Thanks. -- Yi Du [[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

Re: [R] Ask for histogram

2010-01-13 Thread Yi Du
different breakpoints, that is, different boundaries between the histogram bars. -Don At 11:58 AM -0600 1/13/10, Yi Du wrote: Hi, I use a vector of data to draw the histogram, but it is different from the graph by SAS. Can you check it for me please? b is a column vector of 4332 hist(b

[R] Ask about large data set

2010-01-12 Thread Yi Du
Hi, Is that okay to let R to read data set more than 1 rows and use it to do some kernel density estimation? Thanks. Yi -- Yi Du Ph. D student in Economics University of Missouri Department of Economics 118 Professional Building Columbia MO 65211 1-573-239-6467 [[alternative

[R] GMM estimation

2009-11-28 Thread Yi Du
can't get the suitable results. Many thanks. Yi -- [[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

[R] Ask about the memory size problem

2009-10-04 Thread Yi Du
Hi there, I run a loop program with R and need to save the variable in each step into a vector. After I ran the code, R told me that Error: cannot allocate vector of size 266.6 Mb. Is there any solution of this kind of problem? Thank you for your attention. Yi -- Yi Du [[alternative

[R] questions for randomFroest package

2009-02-09 Thread hui-yi Lin
Hi,   I try to use randomFroest package to run SNP data analysis. I have the following questions.    1. Can the outcome variables in Random Forests be binary or continuous? 2. Can the covariates in Random Forests be continuous or categorical? 3. How to define which variables (both outcome and

[R] Problem about Mann-Kendall trend test

2009-02-06 Thread Wang Yi
in advance Regards -- Wang Yi START Regional Center for Temperate East Asia(TEA), Institute of Atmospheric Physics(IAP), Chinese Academy of Sciences(CAS), Qijiahuozi Huayanli 40#, P.O.Box 9804, Beijing 100029,China Tel:13466795920 E-mail:wan...@tea.ac.cn

[R] Fw: Problem about Mann-Kendall trend test

2009-02-06 Thread Wang Yi
-- Forwarded Message --- From: Wang Yi wan...@mail.tea.ac.cn To: r-h...@stat.math.ethz.ch Sent: Fri, 6 Feb 2009 23:30:56 +0800 Subject: Problem about Mann-Kendall trend test Dear all R-users: In my case the series is the annual number of dry spell with their length

[R] KS test for gumbel distribution

2009-02-03 Thread Wang Yi
but I can't find useful information in ks.test help page. Can anyone tell me how to perform the ks test. Thanks a lot for your help. -- Wang Yi START Regional Center for Temperate East Asia(TEA), Institute of Atmospheric Physics(IAP), Chinese Academy of Sciences(CAS), Qijiahuozi

Re: [R] how to get a primitive function object

2009-01-23 Thread Yi Zhang
-intrusive way I can think of--initially I modified R's source code, an even worse option. Patrick Burns -- Yi __ 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

Re: [R] how to get a primitive function object

2009-01-23 Thread Yi Zhang
(expressions=)? I have no clue why infinite recursion... -- Yi __ 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

Re: [R] how to get a primitive function object

2009-01-23 Thread Yi Zhang
and my situation is more complicated than the external ptrs and finalizers can handle. I'll probe the R-devel list and see what I can get. -- Yi __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] how to get a primitive function object

2009-01-22 Thread Yi Zhang
Hi, I want to create an alias for the - function and then later overwrite it. Any idea how I can get the - function object? I know for other functions it's easy, something like f - seq will do; how really no clue for this one. Thanks! __

Re: [R] how to get a primitive function object

2009-01-22 Thread Yi Zhang
On Thu, Jan 22, 2009 at 3:06 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: get(-) will give it to you, and `-` - function(x, y) cat(x=, x, y=, y, \n) will change it -- and will probably be the last effective thing you do in that session, unless you're really careful: x - 1 x [1] 1 `-`

Re: [R] how to get a primitive function object

2009-01-22 Thread Yi Zhang
On Thu, Jan 22, 2009 at 4:17 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Duncan Murdoch wrote: On 1/22/2009 2:41 PM, Yi Zhang wrote: Hi, I want to create an alias for the - function and then later overwrite it. Any idea how I can get the - function object? I know

Re: [R] how to get a primitive function object

2009-01-22 Thread Yi Zhang
(`-`, function(x, value){ if (value is my type) do something [ ] # to bind the object value to symbol x: no matter what you do here, the binding/assignment is local within this function?! }) Hope I have made myself clear. Thanks, -- Yi __ R-help@r

[R] getting caller's environment

2009-01-21 Thread Yi Zhang
Hello, I'm writing a function like this: f-function(x,y,...) { ... assign(x,y,envir=?) } I need the caller (of f) 's environment for the ? so that the assignment is done at the right place. To be specific, when the code f(x,1) appears in environment A, I need the assignment of 1 to x happen in

  1   2   >