Displaying 20 results from an estimated 2000 matches similar to: "plot 3 lines with ggplot2"
2013 Mar 08
2
ggplot2: modifying line width and background fill color for stat_smooth()
In the example below, from
http://www.ling.upenn.edu/~joseff/rstudy/summer2010_ggplot2_intro.html
I'd like to make (a) the fitted line thicker and (b) change the
background fill color for the confidence
envelope around each fitted line to a low-alpha transparent version of
the same color used
for the separate fitted lines for GENDER, rather than grey for both.
How can I do this?
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
Hi,
# For publications, I am not allowed to repeat the axes. I have tried to
remove the axes using:
# yaxt="n", but it did not work. I have not understood how to do this in
ggplot2. Can you help me?
# I also do not want loads of space between the graphs (see below script
with Dummy Data).
# If I could make it look like the examples on the (nice) examples page:
#
2006 Jul 19
1
ASCII dump from an REXP (JRI)
Hi Simon,
Thanks so much for your help. Your advice has been taken to heart. I now
pass in blocks of 100,000 records, and it does 100,000 predictions in
seconds and returns a logical vector with the predictions to an int array.
It works like a charm!
I want to reference what we were talking about earlier. Let?s say we
evaluate an R expression. Is there a way to just print, verbatim, what R
1999 Aug 30
1
rexp and rweibull
In splus rexp() and rweibull() are related:
> set.seed(153)
> rexp(1)
[1] 0.0493267
> set.seed(153)
> rweibull(1, shape=1)
[1] 0.0493267
(you can also try shape =2, then rweibull = sqrt(rexp) )
However, in rw0.64.1 (on Win NT) they are different
> .Random.seed <- 1:4
> rexp(1)
[1] 1.412030
> .Random.seed <- 1:4
> rweibull(1, shape=1)
[1] 2.054032
May be rweibull
2006 Feb 03
2
Problems with ks.test
Hi everybody,
while performing ks.test for a standard exponential distribution on samples
of dimension 2500, generated everytime as new, i had this strange behaviour:
>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)
One-sample Kolmogorov-Smirnov test
data: data
D = 0.0147, p-value = 0.6549
alternative hypothesis: two.sided
>data<-rexp(2500,0.4)
2009 Sep 20
1
Return a list from a .Call but segfaults
Hello,
I call a function via .Call passing to it a raw vector(D) and an
integer(I)
The vector is a series K1,KData1, V1,VData1, K2, KData2, ...
where the integer K1 is the length of Data1 and similarly for Ki (wrt
Datai)(similarly for V*) There 2*I such pairs( (Ki,KDatai), (Vi,VDatai))
The numbers Ki(and Vi) are written in network order.
I am returning a list of I elements each element a
2006 Aug 15
1
rexp question
I am using rexp to generate several exponential distributions. I am passing
rexp a vector of rates , r. I am wanting to simulate a sample of size 200
for each rate so the code looks like: rexp(n=200*length(r),rate=r) this
gives me a vector of the random exponential variables, but they are all
disjointed b/c rexp goes through and simulates an exponential variable for
each rate and it does that 200
2008 Feb 29
1
patch for random.c
Dear all,
while looking for some inspiration of how to organise some code, I
studied the code of random.c and noticed that for distributions with
2 or 3 parameters the user is not warned if NAs are created while such
a warning is issued for distributions with 1 parameter. E.g:
R version 2.7.0 Under development (unstable) (2008-02-29 r44639)
[...]
> rexp(2, rate=Inf)
[1] NaN NaN
Warning
2014 Jan 17
1
rexp, different results on 32/64 bit
Hi all,
I just run into this today. Apparently rexp() sometimes gives different
slightly results for the same seed on 32 bit and 64 bit machines. runif()
is the same for both, so the problem seems to be in rexp().
64 bit Linux is the same as 64 bit OSX, and R-devel gives the same results
as R-3.0.2.
Best,
Gabor
# ---------------------------------------------
> options(digits=22) ;
2017 Oct 27
2
How to do a "Box's M" Test with
Trying to get past a frustrating error to do a "simple" Box's M test using Java.
The Box's M test says it will work with a data.frame.
Here's the setup code:
REXP myDf = REXP.createDataFrame(new RList(
new REXP[]
{
new REXPDouble(d1),
new REXPDouble(d2),
new REXPDouble(d3),
new REXPDouble(d4),
new REXPInteger(d5)
}));
Here's the call:
REXP boxMResult =
2017 Oct 27
0
How to do a "Box's M" Test with
On 27/10/2017 8:10 AM, Morkus via R-devel wrote:
> Trying to get past a frustrating error to do a "simple" Box's M test using Java.
>
> The Box's M test says it will work with a data.frame.
>
> Here's the setup code:
>
> REXP myDf = REXP.createDataFrame(new RList(
> new REXP[]
> {
> new REXPDouble(d1),
> new REXPDouble(d2),
> new
2012 Jan 27
3
generate a random number with rexp ?
dear list
I use runif to generate a ramdom number between min and max
runif(n, min=0, max=1)
however , the syntaxe of rexp does not allow that
rexp(n, rate = 1)
and it generate a number with the corresponding rate.
The question is: how to generate a number between min and max using rexp().
Regards
--
PhD candidate in Computer Science
Address
3 avenue lamine, cité ezzahra, Sousse 4000
2011 Apr 12
0
Help required
Hi Sadaf,
Out of curiosity, what sorts of things have you tried to fix this?
For example, after playing around with this a bit, if I remove your
"eps" parameter from your `ranges` list, it works.
Perhaps you should try tweaking the values you pick for your
parameters. You don't even have to put it in the `tune` function to
get an idea of the ranges you should use:
R>
2005 Jun 14
0
bug in rpart?
Dear R-helpers,
Can you help me to see why "code 1" gives error
while "code 2" runs fine? The only difference in
the data is the distribution of age categories.
I am attaching the session after the code.
Many thanks.
XL
library(survival)
library(rpart)
# code 1
n <- 20
age <- rep(1:3, c(2, 3, 15))
eg<- data.frame(rexp(n), rbinom(n,1,prob=.3), age=age)
2015 Apr 09
2
[LLVMdev] BNF for IL/IR interpreter
This might be a very beginner question, but I'm looking for an example for
something that I have never done.
Suppose that I wanted to express actions with respect to lifted semantics
of CPU instructions to an intermediate representation, BAP IL or LLVM IR.
How might I go about providing a Backus Naur Form specification and then
dynamically interpreting those lifted instructions by also
2017 Oct 27
0
Cannot Compute Box's M (Three Days Trying...)
Does it work if you supply the closing parenthesis on the call to boxM?
The parser says the input is incomplete and a missing closing parenthesis
would cause that error..
// create a string command with that variable name.String boxVariable =
"boxM(boxMVariable [,-5], boxMVariable[,5]";
// try to execute the command...
// FAILS with org.rosuda.REngine.Rserve.RserveException: eval
2017 Oct 26
1
How to create a table structure in Java code?
Thanks! I just figured it out (thanks to "Beyond Compare") and was coming here to post back.
The boxM test doesn't work with that (now, finally working) REXP structure, but I probably now need to create a table or something and parse that structure.
So much fun! :)
Thanks again.
- M
Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
> --------
2012 Apr 03
1
rpart error message
Hi R-helpers,
I am using rpart package for decision tree using R.We are invoking R
environment through JRI from our java application.Hence, the result of R
command is returned in REXP and we use geterrMessage() to retrieve the
error.
When we execute the following command,
cnr_model<-rpart(as.factor(Species)~Sepal Length+Sepal Width+Petal Length,
method="class",
2011 Aug 17
3
How to apply a function to subsets of a data frame *and* obtain a data frame again?
Dear all,
First, let's create some data to play around:
set.seed(1)
(df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10),
Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),])
## Now we need the empirical distribution function:
edf <- function(x) ecdf(x)(x) # empirical distribution function evaluated at x
##
2012 Jun 30
2
incorrect number of subscripts on matrix
Hi,
Wondering if anyone could help me out with this error.Im trying to fill a matrix with random numbers taken from an exponential distribution using a loop:
x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for(i in 1:1000){x[i,]<-rexp(3,rate=2/3)}
I get the error message:
Error in x[i, ] <- rexp(3, rate = 2/3) : incorrect number of subscripts on matrix
Any ideas??? Appreciate any thoughts.