[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.6029

[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 co

Re: [R] Concentration ellipsoid

2009-09-06 Thread RON70
tion. Any help please? Thanks, 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

[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: http://www.nabble.com/Searching

[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? Thanks

[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: http://

[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[

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: >> >

Re: [R] Question on qplot

2009-07-18 Thread RON70
;)$Version # devel version > [1] "1.6-0" >> R.version.string # Windows Vista > [1] "R version 2.9.1 Patched (2009-07-16 r48939)" > > For the devel version of zoo see the installation instructions > at the bottom of:: > http://r-forge.r-project.org/scm/?gr

Re: [R] Question on qplot

2009-07-18 Thread RON70
0.8.2 reshape_0.8.2 plyr_0.1.9 proto_0.3-8 > zoo_1.5-5 > [6] mblm_0.11 chron_2.3-30lattice_0.17-25 Design_2.1-2 > 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,

[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

[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

[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 = rep

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) > libra

[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 = "

[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 N

[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: http://www.nabble.com/Searching-w

Re: [R] Searching within a ch. string

2009-05-14 Thread RON70
s, > > -- > *Luc Villandré* > /Biostatistician > McGill 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 : &

[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: http://www.nabble.com/Altering-columns-tp2409959

[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: http://www.nabble.com/Eigen-value-calculation-tp24147807p241478

[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 elem

[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 : > > libra

Re: [R] Downloading data from Economagic

2008-12-30 Thread RON70
00 0.40.437500.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: >

Re: [R] Downloading data from Economagic

2008-12-31 Thread RON70
ersion of zoo: > > source("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/as.zoo.R?rev=557&root=zoo";) > z <- as.zoo(dat2) > time(z) <- as.Date(time(z)) # optional > > > > On Tue, Dec 30, 2008 at 6:25 AM, RON70 wrote: >> >

[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 <- fu

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

2009-01-11 Thread RON70
) > lines(x1, pfunc(x1), col=2, lty=2) > > solve(p) # gives you the roots (some are, of course, complex) > > > Hope this helps, > Ravi. > > > > ____ > > Ravi Varadhan, Ph.D. > Assistant P

[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] 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] 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: http://www.nabble.com/How-R-cal

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? > &

[R] How to extract following data

2008-11-04 Thread RON70
Hi everyone, I have this kind of raw dataset : - 2005-01-17T00:00:00+05:30 10149 1288.40002 - 2005-01-18T00:00:00+05:30 10149 1291.69995 - 2005-01-19T00:00:00+05:30 10149 1288.19995 I was looking for some R procedure to extract data from this, that should

[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 messag

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 go

[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: http://www.nabble.com/How-to-Clear-all-v

[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

[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 m

Re: [R] How to solve following equation?

2008-12-03 Thread RON70
92 > [1] 0.8554268 > [1] 0.829437 > [1] 0.8454056 > [1] 0.835527 > [1] 0.8416126 > [1] 0.837854 > [1] 0.8401717 > [1] 0.838741 > [1] 0.8396236 > [1] 0.839079 > [1] 0.839415 > [1] 0.8392076 > [1] 0.8393356 > [1] 0.8392566 > [1] 0.8393053 > [1] 0.8392753 > [1

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 whi

Re: [R] Sorting a date vector

2008-12-16 Thread RON70
mat more closely. Both the > separator 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" > >

[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" "1