Displaying 20 results from an estimated 5000 matches similar to: "Question on qplot"
2008 Dec 30
5
Downloading data from Economagic
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 actual data is available from 2001.
secondly, how I convert that data
2008 Dec 02
3
How to solve following equation?
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 mailing list archive at Nabble.com.
2009 May 07
1
I updated/reinstalled ggplot2 and the trouble started...
Hi Ian,
Per your suggestion, I reinstalled R 2.9.0, then
I reinstalled ggplot2 on top. The problem persists.
Here's the what happens after the installation:
> qplot (carat, price, data = diamonds, alpha = I(1/10))
Warning message:
In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only once per
2009 Jan 11
4
How to get solution of following polynomial?
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)
{
y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
2009 Sep 11
2
Searching 1st number within a ch. string
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-1st-number-within-a-ch.-string-tp25400580p25400580.html
Sent from the R help
2010 Apr 18
4
confused with yearmon, xts and maybe zoo
R-listers,
I am using xts with a yearmon index, but am getting some inconsistent
results with the date index when i drop observations (for example by using
na.omit).
The issue is illustrated in the example below. If I start with a monthly
zooreg series starting in 2009, yearmon converts this to "Dec-2008". Not
such a worry for my example, but strange. Having converted to xts, i drop
2009 May 11
3
Searching within a ch. string
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-within-a-ch.-string-tp23484010p23484010.html
Sent from the R help mailing list
2010 Jul 13
3
Need help on index for time series object
Dear all,
Please forgive me if there is a duplicate post; my previous mail perhaps didnt reach the list.......
Let say I have following time series
library(zoo)
> dat1 <- zooreg(rnorm(10), start=as.Date("2010-01-01"), frequency=1)
> dat1[c(3, 7,8)] = NA
> dat1
2010-01-01 2010-01-02 2010-01-03 2010-01-04 2010-01-05 2010-01-06 2010-01-07 2010-01-08 2010-01-09
2008 Nov 05
2
How to extract following data
Hi everyone,
I have this kind of raw dataset :
- <Temp diffgr:id="Temp14" msdata:rowOrder="13">
<Date>2005-01-17T00:00:00+05:30</Date>
<SecurityID>10149</SecurityID>
<PriceClose>1288.40002</PriceClose>
</Temp>
- <Temp diffgr:id="Temp15" msdata:rowOrder="14">
2009 Nov 16
2
How to make all elements all elements lower-cap ?
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 Nabble.com.
2009 Sep 25
3
Problem on plotting TS using GGPLOT
Hi, I have following codes :
library(zoo); library(ggplot2); library(plyr)
dat <- rnorm(306); vv <- letters[1:6]; dat1 <- data.frame(dat, vv)
dat2 = zooreg(rnorm(51), as.yearmon(as.Date("2000-01-01")), frequency=12)
ggplot(dat1) +
geom_line(aes(y=dat, x=index(dat2), colour=vv), group=vv, size =
1.3)
However I got error while plotting them :
2010 Mar 22
1
Replacing elements of list
Dear all,
I have following two list object, both are basically collection of matrices
:
dat1 <- matrix(rnorm(25*6), ncol=6)
dat1 <- split(dat1, seq(5,25,by=5))
dat1 <- lapply(dat1, matrix, ncol=6)
dat2 <- matrix(rnorm(25*4), ncol=4)
dat2 <- split(dat2, seq(5,25,by=5))
dat2 <- lapply(dat2, matrix, ncol=4)
Now I want to replace last 4 columns of each matrix at "dat1"
2010 Aug 20
2
Determining the length of unique items in a vector
Dear all, let suppose I have following vector:
> dat1 <- c(rep("asd", 5), rep("xyz", 12), rep("erd", 17))
> dat1 <- dat1[sample(1:length(dat1), length(dat1), replace=F)]
> dat1
[1] "erd" "xyz" "erd" "asd" "asd" "erd" "xyz" "asd" "erd" "erd"
2009 Jul 23
1
Another question on gplot
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 me why it is coming?
--
View this message in context:
2008 Nov 22
1
How to draw following plot in R?
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 frequency of "data" for a particular
2009 Jul 23
3
how to predict dynamic model in R
I have a dynamic time series model like this:
dyn$lm( y ~ lag(y,-1) + x + lag(x,-1)+lag(x,-2) )
I need to do an out of sample forecast with this model. Is there any way I
can do this with R?
It would be greatly appreciated if some one can give me an example. Thanks.
Harry
[[alternative HTML version deleted]]
2008 Feb 21
2
jpeg() creating empty files with qplot() in a loop
Hello all,
I'm stuck with a strange issue with writing jpegs of plots to a folder
in a loop.
This works:
for (step in 1:length(steps)) {
jpeg(filename=paste("frame_",sprintf("%05d",step),".jpg",sep=""))
plot(steps[[step]])
dev.off()
}
But if I use qplot to generate the plot (which is my aim):
for (step in 1:length(steps)) {
2009 Mar 12
3
Unable to run smoother in qplot() or ggplot() - complains about knots
I get the following error when I run qplot()
qplot(grade, read,data = hhm.long.m, geom = c("point", "smooth"))
Error in smooth.construct.cr.smooth.spec(object, data, knots) :
x has insufficient unique values to support 10 knots: reduce k.
I am not sure how to tackle this problem. When I take a subsample (<
1000) than I am able to run that function but with my sample
2010 Apr 13
1
Merging "list" object
Hi, I have created following "list" object :
> library(zoo)
> dat <- vector("list")
> for (i in 1:4) dat[[i]] <- zooreg(rnorm(i*10),
> start=as.Date("2000-01-01"), frequency=1)
> dat[[1]]
2000-01-01 2000-01-02 2000-01-03 2000-01-04 2000-01-05 2000-01-06 2000-01-07
2000-01-08 2000-01-09 2000-01-10
-0.7023352 -0.2063284 -1.0684688 -0.5345360
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
R-users it appears I am leaning on your knowledge once again. Is there any way to add a vertical line to a histogram and qplot "stacked" plot? Here is my current attempt:
"qplot" approach attempt:
qplot(Run, data = data_dataframe, breaks = breaks, fill = Temperature, main = short_title) + scale_x_continuous("Data") + scale_y_continuous("Freq")