[R] Summing up Non-numeric column

2010-12-07 Thread zhiji19
Dear All If I have the following dataset V1 V2 x y y x z b a c b j d l c o How do I use R command to get the total number of different letter in column V1 column V1 has 7 different letters. Thank you -- View this message in context:

Re: [R] Summing up Non-numeric column

2010-12-07 Thread zhiji19
Thanks a lot -- View this message in context: http://r.789695.n4.nabble.com/Summing-up-Non-numeric-column-tp3077710p3077733.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Loading .RData from Internet

2010-12-06 Thread zhiji19
Dear All, Can you please suggest me a correct way to load the following R data frame from the internet and save it to the hard drive? The following is what I tried: raceprofiling - read.table(http://rss.acs.unt.edu/Rdoc/library/twang/data/raceprofiling.RData;) save(raceprofiling, file =

Re: [R] Loading .RData from Internet

2010-12-06 Thread zhiji19
I tried the load() already. It does not work. The erro is shown as following: Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection In addition: Warning message: In readChar(con, 5L, useBytes = TRUE) : cannot open compressed file

[R] How to this SAS transport file in R?

2010-12-05 Thread zhiji19
Dear All, I try to read the SAS transport file in R, but it shows error. Please help! I am using R 2.11.1 library(foreign) download.file(http://isites.harvard.edu/fs/docs/icb.topic35387.files/demo_c.xpt,C:/Desktop/demo_c.xpt;) sasxport - read.xport(C:/Desktop/demo_c.xpt) Error in

[R] Help with Iterator

2010-11-09 Thread zhiji19
Dear Experts, The following is my Iterator. When I try to write a new function with itel, I got error. This is what I have: supDist-function(x,y) return(max(abs(x-y))) myIterator - function(xinit,f,data=NULL,eps=1e-6,itmax=5,verbose=FALSE) { + xold-xinit + itel-0 + repeat { +

[R] Exponent of asymmetric matrix

2010-11-09 Thread zhiji19
Dear Experts, the exponent of asymmetric matrix makes me very curious. can anyone please explain to me what will happen if we apply exponent to the asymmetric matrix? Thank you very much -- View this message in context:

[R] matrix limit

2010-11-09 Thread zhiji19
Dear experts, I need to write R code for lim(I+X/n)^n with repeat loop. (note: limit is n from 1 to infinity, I is identity matrix, X is square symmetric matrix) Can anyone please provide help with my question. Thank you. -- View this message in context:

[R] Exponent of sqr symmetric matrix

2010-11-07 Thread zhiji19
Dear R experts, I really have difficulty when I try to deal with this question. suppose X is a square symmetric matrix. The exponent of X is defined by the matrix limit as following: exp(X) = lim (I + X/n)^n, note: the limit is from n to infinite. How can I write R function for the above?

[R] .R file

2010-10-25 Thread zhiji19
Hello everyone Can you please teach me how to save my homework as .R file? I write my code in RGui. When I tried to save my work, the RGui only allows me to save it as .RData. By the way, after I save my work as .RData, I cannot reopen it. when I open it, only one message comes out as

[R] How to save R file into specific type

2010-10-25 Thread zhiji19
Hello everyone Can you please teach me how to save my homework as .R file? I write my code in RGui. When I tried to save my work, the RGui only allows me to save it as .RData. Is there any difference between .R and .RData? By the way, after I save my work as .RData, I cannot reopen it. when