[R] All combination

2009-11-13 Thread RON70
Please consider the following : expand.grid(rep(list(c(1:3)), 3)) Var1 Var2 Var3 1 111 2 211 3 311 4 121 5 221 6 321 7 131 8 231 9 331 10112 11212 1231

[R] How to make all elements all elements lower-cap ?

2009-11-15 Thread RON70
I have a vector of letters like c(a, B, c). Is there any R function to force all elements to lower-cap ? Thanks, -- View this message in context: http://old.nabble.com/How-to-make-all-elements-all-elements-lower-cap---tp26365794p26365794.html Sent from the R help mailing list archive at

[R] Eigen value calculation

2009-06-22 Thread RON70
Hi all, Eigen vectors obtained from the function eigen() are ortho-normal? I see the documentation however there is no formal mention on that. If no, then is there any direct function to do the same? -- View this message in context:

[R] Question on qplot

2009-07-18 Thread RON70
Hi, suppose I have following codes : library(zoo); library(ggplot2) dat - matrix(rnorm(500*2), 500); dat - zooreg(dat, start = as.Date(01/01/01, %m/%d/%y), frequency=1); plot(dat) head(dat); month.no - format(index(dat), %m); dat1 - cbind(coredata(dat), as.numeric(month.no)) x - dat1[,1]; y -

Re: [R] Question on qplot

2009-07-18 Thread RON70
the plots I am getting is here : http://www.2shared.com/file/6739681/d4c6c9d3/plot.html and http://www.2shared.com/file/6739673/bd50b430/plot.html How you are getting transposed one? smu-2 wrote: hey, On Sat, Jul 18, 2009 at 01:52:34AM -0700, RON70 wrote: Hi, suppose I have following

Re: [R] Question on qplot

2009-07-18 Thread RON70
I have updated the ggplot2 package as well as R, how got some new error. qplot(x, z) Error in get(new, env = FacetGrid, inherits = TRUE)(FacetGrid, ...) : could not find function is.formula I cannot understand what is happening with my system. Here I am providing the details of my system

Re: [R] Question on qplot

2009-07-18 Thread RON70
survival_2.35-4 [11] Hmisc_3.5-2 loaded via a namespace (and not attached): [1] cluster_1.12.0 tools_2.9.1 On Jul 18, 2009, at 2:32 PM, RON70 wrote: I have updated the ggplot2 package as well as R, how got some new error. qplot(x, z) Error in get(new, env = FacetGrid, inherits = TRUE

[R] Merging lot of zoo objects

2009-07-21 Thread RON70
Hi, I have 100 price data series like price1, price2, price3, . All are zoo objects. Now I want to merge all them together. Obviously I can do this using merge(price1, price2, price3, ). However as I have lot of price series (almost 1000) above systax is very tiresome. Is

[R] Question on qplot

2009-07-22 Thread RON70
I have following code on qplot : library(ggplot2) ggplot() + geom_histogram(aes(x=rnorm(100), fill=..count..), xlab=, ylab=) However above code doesnot seem to remove the xlab ylab. What is the correct code? I also want to remove the color-palate in the right side. Is there any way to do that?

[R] Another question on gplot

2009-07-23 Thread RON70
I am getting following strange error : library(sn) library(ggplot2) dat1 - as.matrix(rsn(1000, 0, 1, 0))[,1] ggplot() + geom_histogram(aes(x = dat1, y = ..density.., fill = ..count..)) + xlab(Distribution) + scale_y_continuous() Error: No data for layer Can anyone please tell

[R] ggplot question

2009-07-24 Thread RON70
In page http://had.co.nz/ggplot2/scale_date.html , there is a time series plot for multiple variables at the bottom. i.e qplot(date, value, data = em, geom = line, group = variable) + + facet_grid(variable ~ ., scale = free_y) How can I make different color for different series? Thanks --

Re: [R] legend title in qplot

2009-07-24 Thread RON70
Thank you for your reply. Yes I am reading that document and ofcourse simultaniously trying to apply in my current problem as well. Yes still I am learning. Here I have my code : library(ggplot2) library(plyr) dat = rnorm(1000); variable = rep(c(Variable:1, Variable:2), each=500); coll =

Re: [R] legend title in qplot

2009-07-24 Thread RON70
PLEASE IGNORE MY PREVIOUS MAIL RON70 wrote: Thank you for your reply. Yes I am reading that document and ofcourse simultaniously trying to apply in my current problem as well. Yes still I am learning. Here I have my code : library(ggplot2) library(plyr) dat = rnorm(1000); variable

[R] Density plot in ggplot2

2009-07-28 Thread RON70
Hi all, I was trying to draw a stacked density plot like that : library(ggplot2); library(plyr) dat - cbind(rnorm(300), rep(c(1,2), each=150)) ggplot() + geom_density(aes(x=dat[,1], fill=factor(dat[,2]), position=stack)) + xlab() + ylab() + scale_colour_manual(name = Pallet,

[R] Seed of Random number generation

2009-05-01 Thread RON70
Dear all, is it possible to extract the seed that was used for some random number generation? For example suppose I draw a random sample of size 1000 from a normal population : rnorm(1000) Now I want to know what seed R used for that sample generation. Any way out? Thanks and regards, -- View

Re: [R] Double summation limits

2009-05-01 Thread RON70
Can anyone please explain me why it is not coming? I have done following : j=1 i=0:j; sum( choose(i+j,i) ) [1] 3 j=2 i=0:j; sum( choose(i+j,i) ) [1] 10 j=3 i=0:j; sum( choose(i+j,i) ) [1] 35 j=0:3; i=0:j; sum( choose(i+j,i) ) Warning message: In 0:j : numerical expression has 4 elements:

[R] Searching within a ch. string

2009-05-11 Thread RON70
Hi all, is there any function to find some words in a character-string? For example suppose the string is : gdfsa-sdhchc-88, now I want to find whether this string contains sdhch. Is there any R function to do that? Regards, -- View this message in context:

Re: [R] Searching within a ch. string

2009-05-14 Thread RON70
University Health Center - Montreal Children's Hospital Research Institute/ RON70 wrote: Hi all, is there any function to find some words in a character-string? For example suppose the string is : gdfsa-sdhchc-88, now I want to find whether this string contains sdhch. Is there any R function

[R] Altering columns

2009-06-18 Thread RON70
Hi, Suppose I have following dataset : mat - matrix(rnorm(100), 50) Now I want to put 2nd column in the place of 1st and 1st column in the place of 2nd. Is there any quick way to do that? Thanks and regards, -- View this message in context:

[R] How R calculate p-value ?

2008-11-01 Thread RON70
I am wondering how R calculate p-value for a test. Does R do some Approximate integration on the p.d.f of null distribution? How I can see the code for this particular calculation? Your help will be highly appreciated. Regards, -- View this message in context:

Re: [R] How R calculate p-value ?

2008-11-01 Thread RON70
Still no reply. Is my question not understandable at all? RON70 wrote: I am wondering how R calculate p-value for a test. Does R do some Approximate integration on the p.d.f of null distribution? How I can see the code for this particular calculation? Your help will be highly

[R] How to extract following data

2008-11-04 Thread RON70
Hi everyone, I have this kind of raw dataset : - Temp diffgr:id=Temp14 msdata:rowOrder=13 Date2005-01-17T00:00:00+05:30/Date SecurityID10149/SecurityID PriceClose1288.40002/PriceClose /Temp - Temp diffgr:id=Temp15 msdata:rowOrder=14 Date2005-01-18T00:00:00+05:30/Date

[R] [Stat related] Understanding Portmanteau test

2008-11-07 Thread RON70
Sorry to be off-topic. Can somebody please explain me what is Portmanteau test? Why it's name is like that? When I would say, a particular test is portmanteau test? I did some googling but got no satisfactory answer at all. Please anybody help for understanding that? Regards, -- View this

Re: [R] [Stat related] Understanding Portmanteau test

2008-11-08 Thread RON70
Still waiting for some input. Did my question void forum rule in any manner? RON70 wrote: Sorry to be off-topic. Can somebody please explain me what is Portmanteau test? Why it's name is like that? When I would say, a particular test is portmanteau test? I did some googling but got

[R] How to Clear all variables stored in current and previous sessions

2008-11-20 Thread RON70
Is there any function in R to clear values from all variables stored in current and previous sessions? R site search do not give the desired result at all, all results are about to clear screen only not variables. Thanks, -- View this message in context:

[R] How to draw following plot in R?

2008-11-22 Thread RON70
I want to draw following plot, given here http://www.2shared.com/file/4327128/830b82c4/pic.html for the following data : dat - cbind(rnorm(100), sample(c(1:4), 1000, T)) colnames(dat) - c(data,level) Here x-axis should be on data and y-axis is for level and z-axis should be to display the

[R] How to solve following equation?

2008-12-01 Thread RON70
I need to solve a equation like this : a = b/(1+x) + c/(1+x)^2 + d/(1+x)^3 where a,b,c,d are known constant. Is there any R-way to do that? Thanks in advance -- View this message in context: http://www.nabble.com/How-to-solve-following-equation--tp20785063p20785063.html Sent from the R help

Re: [R] How to solve following equation?

2008-12-03 Thread RON70
] 0.8392566 [1] 0.8393053 [1] 0.8392753 [1] 0.8392938 On Mon, Dec 1, 2008 at 9:47 PM, RON70 [EMAIL PROTECTED] wrote: I need to solve a equation like this : a = b/(1+x) + c/(1+x)^2 + d/(1+x)^3 where a,b,c,d are known constant. Is there any R-way to do that? Thanks in advance -- View

Re: [R] Seasonality in time series

2008-12-06 Thread RON70
using decompose() function how can I get only seasonally adjusted series? GR-13 wrote: Here's something that may help you get started: library(ts) ?decompose ?stl Thanks, -Girish On Dec 5, 1:55 pm, Matthias [EMAIL PROTECTED] wrote: Hi, I?m looking for a package which includes a

Re: [R] Sorting a date vector

2008-12-16 Thread RON70
and the year format specs fail to match your input. as.Date(10-02-2008, format = %m/%d/%y) [1] NA as.Date(10-02-2008, format = %m-%d-%Y) [1] 2008-10-02 -- David Winsemius On Dec 16, 2008, at 7:54 AM, RON70 wrote: I have a date-like-vector like : date_file 10-02-2008 10-03-2008

[R] Sorting a date vector

2008-12-16 Thread RON70
I have a date-like-vector like : date_file 10-02-2008 10-03-2008 10-06-2008 10-07-2008 10-09-2008 10-10-2008 10-13-2008 10-14-2008 10-15-2008 10-16-2008 10-17-2008 10-20-2008 10-21-2008 10-22-2008 10-23-2008 10-24-2008 10-28-2008 10-29-2008 10-30-2008 10-31-2008 11-03-2008 11-04-2008

[R] R function to calculate number of data points of each level

2008-12-17 Thread RON70
I have a dataframe with two columns : 11600 238'4 12000 218'0 12200 209'0 12600 192'0 13000 176'4 14000 145'0 15000 119'0 16000 103'0 1800080'0 1900068'3 2 59'0 11600 208'1 12000 189'2 12200 180'3 There are repeatations in 1st column and I want to use this as

[R] Downloading data from Economagic

2008-12-30 Thread RON70
I was trying to dw data from Economagic [http://www.economagic.com/em-cgi/data.exe/libor/day-ussnon], using following code : library(fimport) dat2 = economagicSeries(libor/day-ussnon, frequency = daily) Here I see that data is not complete, downloaded data starts from 2007-12-31 , whereas

Re: [R] Downloading data from Economagic

2008-12-30 Thread RON70
Oh my mistake, I missed the argument nDaysBack = 366. However pls let me know how to change the data to zoo object. RON70 wrote: I was trying to dw data from Economagic [http://www.economagic.com/em-cgi/data.exe/libor/day-ussnon], using following code : library(fimport) dat2

Re: [R] Downloading data from Economagic

2008-12-30 Thread RON70
0.443750.80625 2008-11-25 2008-11-26 2008-12-08 2008-12-10 2008-12-11 2008-12-12 2008-12-15 2008-12-16 0.931250.987500.186250.125000.115000.118750.11938 0.15938 Can anyone please tell me whether I missing something? RON70 wrote: I was trying to dw

Re: [R] Downloading data from Economagic

2008-12-31 Thread RON70
/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/as.zoo.R?rev=557root=zoo;) z - as.zoo(dat2) time(z) - as.Date(time(z)) # optional On Tue, Dec 30, 2008 at 6:25 AM, RON70 ron_michae...@yahoo.com wrote: Oh my mistake, I missed the argument nDaysBack = 366. However pls let me know how to change

[R] How to get solution of following polynomial?

2009-01-10 Thread RON70
Hi, I want find all roots for the following polynomial : a - c(-0.07, 0.17); b - c(1, -4); cc - matrix(c(0.24, 0.00, -0.08, -0.31), 2); d - matrix(c(0, 0, -0.13, -0.37), 2); e - matrix(c(0.2, 0, -0.06, -0.34), 2) A1 - diag(2) + a %*% t(b) + cc; A2 - -cc + d; A3 - -d + e; A4 - -e fn - function(z)

Re: [R] How to get solution of following polynomial?

2009-01-11 Thread RON70
School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: RON70 ron_michae...@yahoo.com Date: Sunday, January 11, 2009 1:05 am Subject: [R] How to get solution of following polynomial? To: r-help@r-project.org Hi, I

[R] How to get Communication matrix ?

2009-01-18 Thread RON70
A communication matrix K is such that : K * VEC(A) = VEC(transpose of A). Is there any readily available R function to find that Communication matrix? Thanks -- View this message in context: http://www.nabble.com/How-to-get-%22Communication-matrix%22---tp21525220p21525220.html Sent from the R

[R] Serious difference between the result of ADF test in R and Eviews

2009-01-20 Thread RON70
I found there is serious difference between the result of ADF test in R and Eviews, for this data : dat V1 1 -0.075851693 2 -0.046125504 3 -0.009117161 4 0.025569817 5 0.034882743 6 0.073671497 7 0.063805297 8 0.062306796 9 0.072343820 10 0.058354121 11 -0.007635359

[R] A question on List

2009-08-21 Thread RON70
Suppose I have following list : mat - vector(list) for (i in 1:4) mat[[i]] - matrix(rnorm(25),5) mat mat [[1]] [,1] [,2] [,3] [,4] [,5] [1,] -1.27171814 -0.8087277 -0.4771356 0.6001265 0.9842248 [2,] -1.37337445 1.0754536 -1.6304287 -0.6854075 -0.6029390

[R] Concentration ellipsoid

2009-09-06 Thread RON70
Hi all, Can anyone please guide me how to draw a Concentration ellipsoid for a bivariate system with a bivariate normal dist. having a VCV matrix : Sigma - matrix(c(1,2,2,5), 2, 2) I would like to draw in using GGPLOT. Your help will be highly appreciated. Thanks, -- View this message in

Re: [R] Concentration ellipsoid

2009-09-06 Thread RON70
, RON70 wrote: Hi all, Can anyone please guide me how to draw a Concentration ellipsoid for a bivariate system with a bivariate normal dist. having a VCV matrix : Sigma - matrix(c(1,2,2,5), 2, 2) I would like to draw in using GGPLOT. Your help will be highly appreciated. Thanks

[R] Searching 1st number within a ch. string

2009-09-11 Thread RON70
Hi all, Is there any process to conduct a search for a particular digit or letter in a ch. string? For example I want to make a search where 1st numeric figure appears in the string asd123. Here the answer should be 4 Thanks, -- View this message in context:

[R] A stat related question

2009-09-18 Thread RON70
Can I ask a small stat. related question here? Suppose I have two predictors for a time series processes and accuracy of predictor is measured from MSEs. My question is, if two predictors give same MSE then, necessarily they have to be identical? Can anyone provide me any counter example?

[R] Programming insight

2009-09-22 Thread RON70
Hi all, Most of the time in my programming I use for loop however there will always be some way to use other loop like while, if etc to implement same query. My question is among those different loops which is theoretically fastest and why? Thanks -- View this message in context: