Are you trying to look at the difference in the gamma distributions due to
variations in the shape and scale parameters? In this case, the following
approach might be more straightforward:
## assign parameter values
params <- list(curve1=c(1,1),curve2=c(1,2),curve3=c(1,3))
## define function
g
Hi
Tom La Bone wrote:
> The following code was adapted from an example Vincent Zoonekynd gave on his
> web site http://zoonek2.free.fr/UNIX/48_R/03.html:
>
> n <- 1000
> x <- rnorm(n)
> qqnorm(x)
> qqline(x, col="red")
> op <- par(fig=c(.02,.5,.5,.98), new=TRUE)
> hist(x, probability=T,
> c
I know very little about graphics, so my primitive and brute force solution
would be
plot(density(x[1:30]),col="blue");lines(density(x[31:60]),col="red");lines(density(x[61:90]),col="green")
--- On Mon, 7/7/08, Gundala Viswanath <[EMAIL PROTECTED]> wrote:
> From: Gundala Viswanath <[EMAIL PROT
Hi everyone, when I use the two sample Kolmogorov¨CSmirnov ks2Test like this:
x=read.table("e:/x.txt")
y=rstable(1000,alpha,beta,gamma,delta)
I alway get results as follows:
Warning messages:
1: In ks.test(x = x, y = y, alternative = "two.sided") :
cannot compute correct p-values with ties
2:
Dear Gundala,
It's just a starting points and I'm sure completely sure it will be
improved. Try this (for now):
set.seed(123)
x=c(
rgamma(30,shape=.2,scale=14),
rgamma(30,shape=12,scale=10),
rgamma(30,shape=5,scale=6))
plot(density(x[1:30]),col=2,xlim=range(0,max(density(x)$x)),type='l',main="De
Dear Gundala,
It's just a starting points. I'm sure it could be better. Try this:
set.seed(123)
x=c(rgamma(30,shape=.2,scale=14),rgamma(30,shape=12,scale=10),rgamma(30,shape=5,scale=6))
plot(density(x[1:30]),col=2,xlim=range(0,max(density(x)$x)),type='l',main="Density
for your vector")
points(de
Hi,
I have the following vector
which is created from 3 distinct distribution (three components) of gamma:
x=c(rgamma(30,shape=.2,scale=14),rgamma(30,shape=12,scale=10),rgamma(30,shape=5,scale=6))
I want to plot the density curve of X, in a way that it shows
a distinct 3 curves that represent ea
Your program works as is if you choose Mean but you have
introduced two new errors:
1. SD is not defined in your program.
2. if multiple choices are taken then it will try to pass a vector to
my.match.fun but that calls match.fun which only allows functions
to be passed to it. You will have to t
On 7 July 2008 at 12:07, Jason Lee wrote:
| I checked from Ubuntu distro and the latest package only show 2.5.1. Anyone
| has the similar problem too?
In a particular (and now outdated) release of Ubuntu, yes.
For all versions, see
https://launchpad.net/ubuntu/+source/r-base
and for current
I made some changes and also incorporated your advice :
library(zoo)
Z.index <- as.Date(sample(12450:15500, 3000))
Z.data <- matrix(rnorm(300), ncol = 1)
data1 <- zoo(Z.data, Z.index)
fnc = function(data1)
{
selection2 = select.list(c("Mean", "SD"), multiple = T)
Mean = functi
Hi,
In my experience, I just plot the data set then figure it out.
Maybe you could try this?
I really wonder that there is such a R function exists.
If yes, please let me know.
Thanks
Chunhao Tu
Quoting Gundala Viswanath <[EMAIL PROTECTED]>:
Hi,
Suppose I have a vector of data.
Is there a met
I checked from Ubuntu distro and the latest package only show 2.5.1. Anyone
has the similar problem too?
On Mon, Jul 7, 2008 at 11:39 AM, Jason Lee <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am aware this is somehow FAQ question but I ve been searching from R-cran
> archive about the related matter a
Hi,
I am aware this is somehow FAQ question but I ve been searching from R-cran
archive about the related matter and could not find anything closer to this.
I want to upgrade my R version from 2.5.1. to 2.7.1. What is the best way to
load the latest one apart from installing the packages (tar.gz)
This is correct for larger (more columns) matrices - computing the t(A)*A
matrix and inverting it may cause numerical problems, but this should not be
the case with two columns (one of which is all 1's).
In any case, the matrix depends on vector x only and since it is small (80
entries), the re
On 06/07/2008 7:37 PM, Gabor Grothendieck wrote:
Look at the discussion of zero width lookahead assertions in ?regex .
Use perl = TRUE as previously indicated.
Thanks, this seems to work:
gsub( "(?
On Sun, Jul 6, 2008 at 7:29 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
On 06/07/2008 5:37 P
milton: that was totally your solution. i just changed it for what
hippie dream wanted. hippie dream: you can do ?text to get a better
explanation but
the basic idea is that the first two parameters in text specify the
coordinates at which you put the text and the third param is the text.
so
On 7/07/2008, at 11:05 AM, Moshe Olshansky wrote:
Another possibility is to use explicit formula, i.e. if you are
doing linear regression like y = a*x + b then the explicit formulae
are:
a = (meanXY - meanX*meanY)/(meanX2 - meanX^2)
b = (meanY*meanX2 - meanX*meanXY)/(meanX2 - meanX^2)
whe
Hi,
Suppose I have a vector of data.
Is there a method in R to help us automatically
suggest which distributions fits to that data
(e.g. normal, gamma, multinomial etc) ?
- Gundala Viswanath
Jakarta - Indonesia
__
R-help@r-project.org mailing list
http
Look at the discussion of zero width lookahead assertions in ?regex .
Use perl = TRUE as previously indicated.
On Sun, Jul 6, 2008 at 7:29 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> On 06/07/2008 5:37 PM, (Ted Harding) wrote:
>>
>> On 06-Jul-08 21:17:04, Duncan Murdoch wrote:
>>>
>>> I'm tryi
Dear all,
I'm using tcl/tk to create a program to get answers from the user. I'd like a
way to highlight/emphasize some of the information using colors. It'll be even
better if I can color part of the messages instead of the whole thing.
For example, I want to put the word "Hello" in red:
req
Dear useRs:
Please provide me with your thoughts on an issue related to the design of a
production level system. For example, lets suppose that I need to run the
same R script for a finite sequence of items (e.g., in the energy industry, I
may need to asses the profitability of all gas stations
Actually Ted,
Mark's code worked perfectly although I am not really sure why. I am fairly
confused by Ted'scode anyways, even though I'm sure it is right. Here is
what it amounted to for my case:
plot(Length ~ Width, data=infiltration1, col="blue", xlab = "Width (cm)",
ylab = "Length (m)", xlim=
Thanks a lot, Henrique and Jorge!
--- On Tue, 7/1/08, Jorge Ivan Velez <[EMAIL PROTECTED]> wrote:
> From: Jorge Ivan Velez <[EMAIL PROTECTED]>
> Subject: Re: [R] ignore warning messages?
> To: [EMAIL PROTECTED]
> Cc: "R-help"
> Date: Tuesday, July 1, 2008, 1:12 PM
> Dear Hua,
>
> Try
>
> opti
On 06/07/2008 5:37 PM, (Ted Harding) wrote:
On 06-Jul-08 21:17:04, Duncan Murdoch wrote:
I'm trying to write a gsub() call that takes a string and escapes all
the unescaped quote marks in it. So the string
\"
would be left unchanged, but
\\"
would be changed to
\\\"
because the double ba
I think what he is trying to do is more on the following lines:
D<-NULL; for(i in (1:5)){D<-cbind(D,2.5*i+(0:10)+ 0.5*rnorm(11))}
{plot((0:10),D[,1],pch=49,col="blue",ylim=c(0,25))}
for(i in (2:5)){points((0:10),D[,i],pch=(48+i),col="blue")}
Ted.
On 06-Jul-08 22:47:49, milton ruser wrote:
> Hi H
Thanks Mark Leeds!
Just putting something more on the code:
x<-runif(20)
y<-rnorm(20)
code.level<-sample(1:15,20, replace=T)
df<-data.frame(cbind(x,y, code.level))
plot(y~x, data=df, type="n")
text(df$x, df$y, df$code.level)
Peace,
Miltinho Astronauta
Brazil
On 7/6/08, [EMAIL PROTECTED] <[EM
below is milton's example with the text command changed to be the values
of y itself ? is that what you wanted ?
x<-runif(20)
y<-rnorm(20)
df<-data.frame(cbind(x,y))
plot(y~x, data=df, type="n")
text(df$x, df$y, df$y)
On Sun, Jul 6, 2008 at 6:59 PM, hippie dream wrote:
Thanks Milton,
I
Another possibility is to use explicit formula, i.e. if you are doing linear
regression like y = a*x + b then the explicit formulae are:
a = (meanXY - meanX*meanY)/(meanX2 - meanX^2)
b = (meanY*meanX2 - meanX*meanXY)/(meanX2 - meanX^2)
where meanX is mean(x), meanXY is mean(x*y), meanX2 is mean(
Thanks Milton,
I am finding this a little hard to explain. The code you gave me produced
all 0.0 points whereas what I am looking for are the points to correspond to
a specific column. I'll be explicit. I am graphing the location of 15
objects numbered 1 to 15.
plot(Length ~ Width, data=infiltra
Hi Hippien Dream
If I understood, the code below may help you.
Cheers,
Miltinho Astronauta
Brazil
===
x<-runif(20)
y<-rnorm(20)
df<-data.frame(cbind(x,y))
par(mfrow=c(1,2))
plot(y~x, data=df)
plot(y~x, data=df, type="n")
text(df$x, df$y, "o.o")
On 7/6/08, hippie dream <[EMAIL PROTECT
Hi Humberto,
Instead of starting with a complicated model, how about producing some
graphics to aid your understand of the problem? For this example, I'd
think it would be revealing to look at the proportion of positive
track plates that were positive. If tracks was a variable that summed
up the
I am trying to produce a simple plot where the points in the plot are
actually integers from my data. That is, I am making a length/width plot and
I would like the points, rather dots or triangles, appear as different
numbers corresponding to a column in my data. I have tried using this:
...,pch=
Hi there,
I've hit a bump in writing postscript files with special characters in
the WinAnsi encoding on a windows machine.
Here's some sample code:
###
postscript(file = "test.eps", encoding="WinAnsi.enc",
width = 3, height = 5.5, onefile = TRUE, h
Hi there,
I've hit a bump in writing postscript files with special characters in the
WinAnsi encoding on a windows machine.
Here's some sample code:
###
postscript(file = "test.eps", encoding="WinAnsi.enc",
width = 3, height = 5.5, onefile = TRUE, horiz
On 06-Jul-08 21:17:04, Duncan Murdoch wrote:
> I'm trying to write a gsub() call that takes a string and escapes all
> the unescaped quote marks in it. So the string
>
> \"
>
> would be left unchanged, but
>
> \\"
>
> would be changed to
>
> \\\"
>
> because the double backslash doesn't act
Try adding perl = TRUE
On Sun, Jul 6, 2008 at 5:17 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> I'm trying to write a gsub() call that takes a string and escapes all the
> unescaped quote marks in it. So the string
>
> \"
>
> would be left unchanged, but
>
> \\"
>
> would be changed to
>
> \\\
I'm trying to write a gsub() call that takes a string and escapes all
the unescaped quote marks in it. So the string
\"
would be left unchanged, but
\\"
would be changed to
\\\"
because the double backslash doesn't act as an escape for the quote, the
first just escapes the second. I have
On Sun, Jul 6, 2008 at 3:36 PM, threshold <[EMAIL PROTECTED]> wrote:
>
> Hi, my question concerns the following (guess) easy case. I have daily data
> over 5-year period say
> 199017.24
> 199018.19
> 199019.22
> .
> .
> 199120.11
> 199120.26
> 199122.2
> .
> .
> 199420.0
You are doing a lot of unnecessary work inside each loop. For example the
function
regression() is defined as many as rows*cols times, but only needs to be
defined once.
Similarly getgrid() and getslice() (which does need to be defined inside the j
loop, but
not inside the k loop).
HTH
Ray
Hello All,
Could anybody provide performance benchmarking and workloads for
R?
I came across the following:
http://r.research.att.com/benchmarks/
Could anybody provide any other pointers for benchmarking R?
Cheers!
Isa
[[alternative HTML version deleted]]
_
Open all 80 files at once and then start reading a line from each one
in turn. On my Windows machine I can have 80 open at once. You are
spending all your time 'skipping' records. Code might look something
like this:
# open them all
files <- list()
for (i in fileList) files[[i]] <- file(i, 'r')
On Sun, Jul 6, 2008 at 3:19 PM, Megh Dal <[EMAIL PROTECTED]> wrote:
> Can anyone please tell me why I am getting this error?
>
> library(zoo)
> Z.index <- as.Date(sample(12450:15500, 3000))
> Z.data <- matrix(rnorm(300), ncol = 1)
>
> data1 <- zoo(Z.data, Z.index)
>
> fnc = function(data1)
>{
>
Hi, my question concerns the following (guess) easy case. I have daily data
over 5-year period say
199017.24
199018.19
199019.22
.
.
199120.11
199120.26
199122.2
.
.
199420.05
199424.64
199426.34
and I want to make ts.plot of the 2nd column with respect to year
Hi,
I write the code for you. Hope this helps
SD <- 1
date1 <- seq(as.Date("2001-01-01"), as.Date("2002-12-1"), by = "day")
len1 <- length(date1)
set.seed(1) # to make it reproducible
data1 <- zoo(rnorm(len1), date1)
plot(data1)
# calculation for monthly or quarterly mean
calc = function(frequ =
Can anyone please tell me why I am getting this error?
library(zoo)
Z.index <- as.Date(sample(12450:15500, 3000))
Z.data <- matrix(rnorm(300), ncol = 1)
data1 <- zoo(Z.data, Z.index)
fnc = function(data1)
{
selection2 = select.list(c("Mean"), multiple = F)
Mean = function(dataa) me
Hi everyone, when I use the two sample Kolmogorov¨CSmirnov ks2Test like this:
x=read.table("e:/x.txt")
y=rstable(1000,alpha,beta,gamma,delta)
I alway get results as follows:
Warning messages:
1: In ks.test(x = x, y = y, alternative = "two.sided") :
cannot compute correct p-values with tie
First I would like to say thank you for taking the time to read it.Here is my
problem.
I am running a lmer analysis for binary longitudinal (repeated measures)
data.
Basically, I manipulated fruits and vegetation to two levels each(present
and absent) and I am trying to access how these factors
On 06/07/2008 11:58 AM, Arun Kumar Saha wrote:
I am not sure whether I could understand all things. Here is my code :
library(zoo)
# an reproducible example
SD <- 1
date1 <- seq(as.Date("2001-01-01"), as.Date("2002-12-1"), by = "day")
len1 <- length(date1)
set.seed(1) # to make it reproducible
d
I am not sure whether I could understand all things. Here is my code :
library(zoo)
# an reproducible example
SD <- 1
date1 <- seq(as.Date("2001-01-01"), as.Date("2002-12-1"), by = "day")
len1 <- length(date1)
set.seed(1) # to make it reproducible
data1 <- zoo(rnorm(len1), date1)
plot(data1)
# ca
Hello,
we have 80 text files with matrices. Each matrix represents a map (rows for
latitude and columns for longitude), the 80 maps represent steps in time. In
addition, we have a vector x of length 80. We would like to compute a
regression between matrices (response through time) and x and create
If I had only a very limited time to do this, I might include
'month' as another effect, probably coded as 'sin' and 'cos' on an
annual cycle rather than as 12 individual Indicators. This would allow
you to explore not only main effects but interactions with plots.
Before I did that
On 06/07/2008 10:37 AM, Bert Gunter wrote:
Folks:
I don't know whether the following is a Windows or R problem, nor whether it
is particular to my particular Windows version/setup. So any help would be
appreciated. First the problem, then the info. The following code can be cut
and pasted into y
Hi Hadley,
Thanks for the quick and informative reply.
I did what you suggested, and it was indeed the problem for the axes
lines (both are the same thickness). However, ticks are still
thicker... I am attaching the two pdf files (one with lwd=2, the
other with lwd=3).
Thanks again,
Pedro
A
Em Ter, 2008-07-01 às 13:49 -0400, [EMAIL PROTECTED] escreveu:
> Hi,
>
> I am extracting data from a table where the rows have different column
> lengths,
> and empty columns have NA in them. Whenever I extract a row with some empty
> columns, the resulting vector carries all the NAs. Is there a
Folks:
I don't know whether the following is a Windows or R problem, nor whether it
is particular to my particular Windows version/setup. So any help would be
appreciated. First the problem, then the info. The following code can be cut
and pasted into your R session
#
The following code was adapted from an example Vincent Zoonekynd gave on his
web site http://zoonek2.free.fr/UNIX/48_R/03.html:
n <- 1000
x <- rnorm(n)
qqnorm(x)
qqline(x, col="red")
op <- par(fig=c(.02,.5,.5,.98), new=TRUE)
hist(x, probability=T,
col="light blue", xlab="", ylab="", main="",
On Sun, Jul 6, 2008 at 7:46 AM, Martin Henry H. Stevens
<[EMAIL PROTECTED]> wrote:
> Hi John,
> 1. I do not know why you remove the intercept in the lme model, but keep it
> in the aov model.
> 2. The distributional assumptions are shot --- you can't run any sort of
> normal model with these data.
On Sun, Jul 6, 2008 at 6:33 AM, Pedro de Barros <[EMAIL PROTECTED]> wrote:
> Dear All,
>
> I have been trying to add lines to the axis grobs of plots produced with
> ggplot2.
>
> The code I have used is below. It works, although I do not think it is a
> really elegant way of doing what I want
>
Johannes Huesing wrote:
Dear expRts,
when I try to build a package by myself, the process fails writing the
following messages to 00install.out:
* Installing *source* package 'dynalc' ...
** libs
WARNING: no source files found
chmod: Zugriff auf
„/home/hannes/texte/forschung/clot/programme/dyna
Dear expRts,
when I try to build a package by myself, the process fails writing the
following messages to 00install.out:
* Installing *source* package 'dynalc' ...
** libs
WARNING: no source files found
chmod: Zugriff auf
„/home/hannes/texte/forschung/clot/programme/dynalc.Rcheck/dynalc/libs/*“ n
Hi John,
1. I do not know why you remove the intercept in the lme model, but
keep it in the aov model.
2. The distributional assumptions are shot --- you can't run any sort
of normal model with these data. You might consider some sort of
binomial (metabolite detected vs. not detected).
Hank
Hi hpdutra,
I do not know what section of which Crawley book you are referring
to, but I assume that Crawley's point is to use a binomial error
distribution (logistic regression) rather than a normal model. It is
generally thought that LaPlace methods are more accurate than PQL
methods.
H
On Sun, 2008-07-06 at 13:52 +0200, Troels Ring wrote:
> Dear friends - I'm on windows, R 2.7.0
> I try again asking if anyone can explain why a single pig of 16 makes so
> wild swings.
> Warnings are issued, and they are
> 1: pseudoinverse used at 482.1
> 2: neighborhood radius 242.1
> 3: reciproc
Dear friends - I'm on windows, R 2.7.0
I try again asking if anyone can explain why a single pig of 16 makes so
wild swings.
Warnings are issued, and they are
1: pseudoinverse used at 482.1
2: neighborhood radius 242.1
3: reciprocal condition number 0
4: at 360
5: radius 14400
6: all data on
Dear All,
I have been trying to add lines to the axis grobs of plots produced
with ggplot2.
The code I have used is below. It works, although I do not think it
is a really elegant way of doing what I want
However, I am now noticing that when plotted, the width of the lines
in the axis ar
Bill, while your point is a fair one, as far as it goes,
I (and no doubt others) often run R on low-powered hardware,
and therefore like to restrict overload. MASS is quite a big
package.
I've no dispute with your statement that MASS is both recommended
and universally available. And it is valuabl
On 06/07/2008 4:59 AM, Arun Kumar Saha wrote:
There is "if-else" loop if I have to choose 1 item from a 2-item list.
However if I have a list of 4 items (let say) then how i can choose a single
item without employing 'if-else' loop? I mean in VBA I can use
"select-case", is there any equivalent i
Why don't you try "switch" Let me assume that you want to calculate
a=3 and b =5 by using one of "MEAN", "SUM","MIN", and "MAX functions.
Then you could write your code: (If you want to calculate "MEAN")
example<-function(fun=c("MEAN", "SUM", "MIN", "MAX")){
+ fun<-match.arg(fun);a=3;b=5
I think you want
scales = list(x = list(relation="free"))
On Sun, Jul 6, 2008 at 4:13 PM, <[EMAIL PROTECTED]> wrote:
> I'm creating a lattice barchart based off a pretty complicated data
> structure. The barchart comes out quite nice ( thanks
> to lattice ) but the problem is that the horizontal
There is "if-else" loop if I have to choose 1 item from a 2-item list.
However if I have a list of 4 items (let say) then how i can choose a single
item without employing 'if-else' loop? I mean in VBA I can use
"select-case", is there any equivalent in R as well?
Regards,
[[alternative HT
It is not 'obvious' that SPSS/Minitab/Excel are right -- we quite often
see users who wrongly assume that the autocorrelation is the Pearson
correlation between a series and its lagged values. The correct
definition is given in the reference on the help page for acf.
Please note the footer to
Okay I've included a picture of the plot I've been getting with the commands:
> hist(data,freq=F)
> lines(Y~X)
Basically I want the line circled in red to overlap the histogram because that
line is supposed to represent the exponential decay nature of the histogram.
Thanks!
> -Original Mes
72 matches
Mail list logo