In article <[EMAIL PROTECTED]>,
Felipe Carrillo <[EMAIL PROTECTED]> wrote:
> I can't actually tell which function in R is the
> equivalent to TINV function in Excel.
> Anyone familiar with that function? Thanks
TINV is returns a half range t quantile function and it returns 0 from 1
and 5 milli
Dear friends,
I used the B-spline (degree=1) method to fit the piecewise linear function
and the results are listed below.
m.glm<-glm(mark~x+poly(elevation,2)+bs(distance,degree=1,knots=c(16.13,24))
+bs(y,degree=1,knots=c(-0.4357,-0.3202
)),family=binomial(logit),data=point)
summ
It's not clear what is going on here, but one possibility is
> as.numeric("pi")
[1] NA
Warning message:
NAs introduced by coercion
OTOH, "Inf" works for me.
The difference is that 'Inf' is a standard C99 value (like 1.23), whereas
'pi' is a variable in R. So if you want to allow expressions yo
Hi,
on
http://cran.at.r-project.org/bin/windows/base/rw-FAQ.html#Where-can-I-find-the-latest-version_003f
it says:
... The current release is distributed as an installer
`R-2.6.1-win32.exe' of about 30Mb. ...
however I find this file as well:
http://cran.at.r-project.org/bin/windows/base/R-2.6.2-w
Dear all,
thank you very much for continuing to look into this issue!
I checked the versions and in Gabor's code the spaces and tabs, but
still the problem remains (see code and error below).
To install quantmod, I used this time Rforge and it did not work. I
had to install the "Defaults" package
Hi,
I am moving from MATLAB, where one can easily assign a number of
output values from a function like this:
[x,y] = myfun(a,b)
Then variables x and y can be directly used in the caller workspace.
I understand that R functions return a single argument, which could be
a list. This in a way make
Hi Martin
I am re reading all the mail we exchange with new eyes because of all
the thing I learn in the past few weeks. That very interesting and some
new question occurs...
***
Once, you speak about callGeneric :
setClass("A", representation(x="numeric"))
setC
On Mon, 24 Mar 2008, Thomas Steiner wrote:
> Hi,
> on
> http://cran.at.r-project.org/bin/windows/base/rw-FAQ.html#Where-can-I-find-the-latest-version_003f
> it says:
> ... The current release is distributed as an installer
> `R-2.6.1-win32.exe' of about 30Mb. ...
> however I find this file as wel
On 24/03/2008 5:23 AM, zhijie zhang wrote:
> Dear Rusers,
> I am now using R and SAS to fit the piecewise linear functions, and what
> surprised me is that they have a great differrent result. See below.
You're using different bases. Compare the predictions, not the
coefficients.
To see the
Dear Rusers,
I am now using R and SAS to fit the piecewise linear functions, and what
surprised me is that they have a great differrent result. See below.
#R code--Knots for distance are 16.13 and 24, respectively, and Knots for y
are -0.4357 and -0.3202
m.glm<-glm(mark~x+poly(elevation,2)+bs(di
On 24/03/2008 5:09 AM, Tribo Laboy wrote:
> Hi,
>
> I am moving from MATLAB, where one can easily assign a number of
> output values from a function like this:
>
> [x,y] = myfun(a,b)
>
> Then variables x and y can be directly used in the caller workspace.
>
> I understand that R functions retur
Donna Tucker wrote:
> Is there any way to use more than one color or shape in the same plot. I
> would like to make the points different colors for various levels of a
> variable. I have tried a simple 'if' statement in the plot command, but I
> get an error message. Here is what I have tried
Henrique,
Although your solution is perfect, I had later a problem with setting
the background. Perhaps you know how to get this as well:
set.seed(24032008)
plot(rnorm(10),type="l",col="red")
grid()
front=c(0.5, .97, 0.5, .97)
par(fig=front, new=T)#, bg="skyblue" does not work
rec=c(par("usr")[1]
Dear Murdoch,
"Compare the predictions, not the coefficients.", this is the key point.
I have checked their predicted probability and their results are the
same.
What do you mean by "You're using different bases"? Could you please give
me a little more info on it, so that i can go to find
Perhaps:
set.seed(24032008)
plot(rnorm(10),type="l",col="red")
grid()
front=c(0.5, .97, 0.5, .97)
par(fig=front, new=T)#, bg="skyblue" does not work
set.seed(24032008)
x <- rnorm(4)
plot(x,type="l",col="blue",xlab="",ylab="", bg="yellow")
rect(par("usr")[1], par("usr")[3], par("usr")[2], par("usr"
Bert Gunter wrote:
>
> Yes. And, amazingly, one can find out about it by typing
>
> help.search("t distribution") .
>
> Why don't you try it for yourself?
>
Maybe because the obvious search is
help.search("t")
:-)
Alberto Monteiro
__
R-help@r-proj
You need zoo 1.5-0 and you are using 1.4-2. Also note that
the DF <- line is not needed (though it doesn't hurt either)
and was just there to check your similar statement.
On Mon, Mar 24, 2008 at 4:48 AM, Thomas Steiner <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> thank you very much for continuing
On 24/03/2008 7:06 AM, zhijie zhang wrote:
> Dear Murdoch,
>"Compare the predictions, not the coefficients.", this is the key point.
>I have checked their predicted probability and their results are the
> same.
> What do you mean by "You're using different bases"? Could you please give
>
Dear Murdoch,
Thanks very much for your rapid response. It helps me greatly.
If i want to write the model formula according to the estimets from R, Is
it correct for the below formula? I'm not very sure about it, and i also
hope that you can recommend a good book on this area. I want to learn
On 3/24/2008 9:03 AM, zhijie zhang wrote:
> Dear Murdoch,
> Thanks very much for your rapid response. It helps me greatly.
> If i want to write the model formula according to the estimets from
> R, Is it correct for the below formula? I'm not very sure about it, and
> i also hope that you c
Dear R users,
I need to estimate an ARCH(1,0) model with t-residuals. To do this I use
garchFit
function from fGarch library. However, I get the following error message:
Error in.garchInitParameters (formula.mean = formula.mean, formula.var =
formula.var, ): object "alpha" not found
I tried to
Hi,
Is there are function similar to excel vlookup in R. Please let me know.
Thanks,
Sachin
[[alternative HTML version deleted]]
__
R-help@r-project
I think that merge is what you want:
set.seed(24032008)
x <- data.frame(ID=sample(10), Value=rnorm(10))
idx <- sample(5)
merge(idx, x, by.x=1, by.y=1)
On 24/03/2008, Sachin J <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there are function similar to excel vlookup in R. Please let me know.
>
> Thanks
?findInterval
On 3/24/08, Sachin J <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there are function similar to excel vlookup in R. Please let me know.
>
> Thanks,
> Sachin
>
>
>
>
>
>
>[[alternative HTML v
Another way:
If x is a two column matrix, as suggested by Henrique D.,
IDValue
1 7 0.000656733
2 6 0.201764789
3 1 0.671113391
4 10 -0.739727826
5 9 -1.111310154
6 5 -0.859455833
7 2 -1.408229877
8 8 0.993126295
9 3 -0.171906808
10 4 -0.140107677
And you are loo
Sachin J <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Is there are function similar to excel vlookup in R. Please let me
> know.
>
Caveat: definition of VLOOKUP done from memory and by checking OO.o
Calc function of same name. (Don't have Excel on this machine.)
VLOOKUP looks up a s
Quite right, there is an optional 4th argument, and the table must be
sorted ascending on the first column in Excel. Thus these functions
only approximately duplicate the Excel functions (improve on them IMHO).
BTW, I pasted the wrong formula in my reply; though it works, simpler is
ID <- 4
[EMAIL PROTECTED] wrote:
> Hi Martin
>
> I am re reading all the mail we exchange with new eyes because of all
> the thing I learn in the past few weeks. That very interesting and some
> new question occurs...
>
> ***
> Once, you speak about callGeneric :
>
> se
Hi Henrique,
This is what I am trying to accomplish:
I want to read values in V1 and V2 and populate the column V4 with R or B based
on the
values in V3 i.e. if its A,B,C then its R else if D,F then B. You can assume
V1, V2 are dataframe1
and V3, V4 are in dataframe2 (note V4 is empty initially
Well it looks like you found your answer. Further the fact that my
suggestions of possibilities did not help and the fact that noone else
has chimed in would suggest that there is not any easier way to get your
answer.
I was thinking that taking into account the correlation between the min
and t
# Setup the translation map
transMap <- c(A="R", B="R", C="R", D="B", F="B");
# The input data
v3 <- c("A", "C", "D", "F", "A", "C", "B", "B", "B", "B", "A", "D");
# The translated data
v4 <- transMap[v3];
df2 <- data.frame(V3=v3, V4=v4);
I recommend you to read 'An Introduction to R' that come
Is this what you want?
> control <- data.frame(V1=c("A","B","C","D","F"), V2=c("R","R","R","B","B"))
> test <- data.frame(V3=sample(c("A","B","C","D","F"), 10, TRUE), v4='')
> test
V3 v4
1 A
2 F
3 B
4 F
5 B
6 B
7 C
8 F
9 F
10 B
> test$V4 <- control$V2[match(test$V3, control$V
Levi,
Here is one possible function:
spread <- function(x, mindiff) {
df <- x[-1] - x[-length(x)]
i <- 1
while (any(df < mindiff)) {
x[c(df < mindiff, FALSE)] <- x[c(df < mindiff, FALSE)] - mindiff/10
x[c(FALSE, df < mindiff)] <- x[c(FALSE, df < mindiff)] + mindiff/10
df <- x[-1
Thank you all for your help. I will definately go through the suggested
document.
Thanks again.
Sachin
- Original Message
From: Henrik Bengtsson <[EMAIL PROTECTED]>
To: Sachin J <[EMAIL PROTECTED]>
Cc: Henrique Dallazuanna <[EMAIL PROTECTED]>; r-help@r-project.org
Sent: Monday, March
> callGeneric is an advanced topic.
Ok, when I will be older :-)
>> *
>> This works :
>>
>> setMethod("initialize","B",
>> function(.Object,..., yValue){
>> callNextMethod(.Object, ..., y=yValue)
>> return(.Object)
>> })
>> new("
Hi again R People:
This works fine:
> library(tcltk)
> a <- tclVar("4.5")
> as.numeric(tclvalue(a))
[1] 4.5
> #But if you have:
> b <- tclVar("pi")
> as.numeric(tclvalue(b))
[1] NA
Warning message:
NAs introduced by coercion
>
Is anyone aware of a way around this, please?
thanks,
Erin
--
Erin
Hi,
I am getting this error when I run 'make' under src/library/base:
../../../library/base/R/base is unchanged
../../../bin/R: bad substitution
make: *** [all] Error 1
I traced it down to the following line in src/library/base/Makefile:
@cat $(srcdir)/makebasedb.R | \
R_DEFAULT_
[EMAIL PROTECTED] wrote:
>> callGeneric is an advanced topic.
>
> Ok, when I will be older :-)
>
>>> *
>>> This works :
>>>
>>> setMethod("initialize","B",
>>> function(.Object,..., yValue){
>>> callNextMethod(.Object, ..., y=yValue)
>>>
Erin Hodgess said the following on 3/24/2008 10:39 AM:
> Hi again R People:
>
> This works fine:
>> library(tcltk)
>> a <- tclVar("4.5")
>> as.numeric(tclvalue(a))
> [1] 4.5
>> #But if you have:
>> b <- tclVar("pi")
>> as.numeric(tclvalue(b))
> [1] NA
> Warning message:
> NAs introduced by coerc
On Mon, Mar 24, 2008 at 8:11 AM, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> On 3/24/2008 9:03 AM, zhijie zhang wrote:
> > Dear Murdoch,
>
> > Thanks very
>
> I would use predict() instead. What you have there doesn't look as
> though it uses the B-spline basis.
>
> The reference given in t
try this:
y <- as.matrix(read.table(textConnection(
"A C G T T G C A G C
A C G F F F F F F G
A C G S S S S S G A
A C G T T G C A G G
A B B
Erin Hodgess wrote:
> Hi again R People:
>
> This works fine:
>
>> library(tcltk)
>> a <- tclVar("4.5")
>> as.numeric(tclvalue(a))
>>
> [1] 4.5
>
>> #But if you have:
>> b <- tclVar("pi")
>> as.numeric(tclvalue(b))
>>
> [1] NA
> Warning message:
> NAs introduced by coercion
>
>
>
Thank you!
On 3/24/08, Peter Dalgaard <[EMAIL PROTECTED]> wrote:
> Erin Hodgess wrote:
> > Hi again R People:
> >
> > This works fine:
> >
> >> library(tcltk)
> >> a <- tclVar("4.5")
> >> as.numeric(tclvalue(a))
> >>
> > [1] 4.5
> >
> >> #But if you have:
> >> b <- tclVar("pi")
> >> as.numeric(tc
Since you have posted about this before with errors earlier in the build
process and not told us those were resolved, very likely something prior
to this is the problem.
You will find people here more responsive if you don't disregard the
posting guide, e.g. by sending HTML mail.
On Mon, 24 Ma
> The code example is incomplete, so I don't really know why one
> version assigned y=3 for you and the other did not; for me, neither
> version did the assignment.
I probably add the return in the mail without imagining il will change things.
My question was more on the use of ... versus the a
On Mon, Mar 24, 2008 at 01:09:35PM -0500, Paul Johnson wrote:
> On Mon, Mar 24, 2008 at 8:11 AM, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> > On 3/24/2008 9:03 AM, zhijie zhang wrote:
> > > Dear Murdoch,
> >
> > > Thanks very
> >
> > I would use predict() instead. What you have there doesn't
[EMAIL PROTECTED] wrote:
>> The code example is incomplete, so I don't really know why one version
>> assigned y=3 for you and the other did not; for me, neither version
>> did the assignment.
>
> I probably add the return in the mail without imagining il will change
> things.
>
> My question
I found a package on www.bioconductor.com that allows me to install using
this line:
source("http://bioconductor.org/biocLite.R";)
biocLite("MassSpecWavelet")
The prompt showed me the following message:
Running biocinstall version 2.1.10 with R version 2.6.2
Your version of R requires version
library(MassSpecWavelet)
On 24/03/2008, Chaser <[EMAIL PROTECTED]> wrote:
>
> I found a package on www.bioconductor.com that allows me to install using
> this line:
>
> source("http://bioconductor.org/biocLite.R";)
> biocLite("MassSpecWavelet")
>
> The prompt showed me the following message:
On Mon, 24 Mar 2008, Chaser wrote:
>
> I found a package on www.bioconductor.com that allows me to install using
> this line:
>
> source("http://bioconductor.org/biocLite.R";)
> biocLite("MassSpecWavelet")
>
> The prompt showed me the following message:
>
> Running biocinstall version 2.1.10 with
*Thank you* Greg, this function works perfectly! I had imagined that
the ideal solution would iteratively modify the vector to fix new
violations of mindiff created by each subsequent spreading of tight
clusters, but couldn't figure how to do it. A small note, the vector
x must be sorted before u
I think I've gotten my Emacs/Sweave/R system set up correctly, thanks to
Vincent and Jim, but I haven't been successful getting my first document
produced. I'm trying to use one of Friedrich Leisch's examples,
http://www.ci.tuwien.ac.at/~leisch/Sweave/example-1.Snw. I cut and
pasted the text into a
Would this function be worth submitting to some existing cran library?
I'd be willing to document it and add error-checking if there is
somewhere that it belongs (with credit to Greg of course, unless Greg
wants to submit it himself).
I am using it in conjunction with a function I wrote which dra
Wonderful, thanks a lot.
I just have to call the plot first and then the rect (and then I can
plot it again)... %D
Have a nice day,
Thomas
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hi.
As shown in the simplified example below, I'm having trouble allocating
memory for large vectors, even though it would appear that there is more
than enough memory available. That is, even with a memory limit of 1500 MB,
R 2.6.1 (Win) will allocate memory for a first vector of 2
Sorry if this is an FAQ, but I haven't found the answer (yet)...
I'm trying to plot each row of a simple numeric matrix in a separate
panel using the layout features of lattice, but can't make it work -
help would be appreciated!
Example:
> m <- matrix(seq(1:20), nrow=4)
> m
[,1] [,
Thanks so much for all the input; I appreciate it.
I think I'll stick with Tcl/Tk for now primarily on the basis of
installation issues. I'm not sure that many of these users would have Java,
so the other alternatives all seemed to add another level of complexity on
to the installation task (agai
See ?"Memory-limits" and rw-FAQ Q2.9. Since you have already used more
than 1Gb of what is presumably a 2Gb address space (we don't know your
Windows version), it is not surprising that there is no 285Mb hole left.
On Mon, 24 Mar 2008, Ronnen Levinson wrote:
>
> Hi.
> As shown in the simpl
Hello All,
I've been using R for a while and decided to test R from the svn trunk. I
know that trunk is not stable, but I wanted to see if I can install and run
the latest rpy on my Ubuntu 7.10 box. It installed ok, but I got the
runtime error message:
$ python
Python 2.5.1 (r251:54863, Mar 7
I never knew to enter that command in.
Thanks guys!
--
View this message in context:
http://www.nabble.com/Simple-problem-in-R-tp16259116p16260713.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
http
Bob and Deb wrote:
> Hello All,
>
> I've been using R for a while and decided to test R from the svn trunk. I
> know that trunk is not stable, but I wanted to see if I can install and run
> the latest rpy on my Ubuntu 7.10 box. It installed ok, but I got the
> runtime error message:
>
> $ python
Hi, I posted this message earlier in "Rmetrics" and I don't know whether I
posted in the wrong place, so I'm posting it again in Rhelp.
I have a function in x and y and let's call it f(x,y). I need to get the
Hessian matrix. i.e I need (d^2f/dx^2), (d^2f/dxdy), (d^2f/dydx),
(d^2f/dy^2).I can get
Is this in a windows system? A TA of mine was just getting the exact
same message. He tracked it down to the pathname for Sweave.sty having
trouble with "Program Files" in the path.
Kevin
Zembower, Kevin wrote:
> I think I've gotten my Emacs/Sweave/R system set up correctly, thanks to
> Vincent
Thanks everyone for your help the qt function worked
like a dream. I ended up using it like this;
T <- qt((1-0.05/2),7) to estimate 95% intervals
divided by 2. 7 would be the number of days sampled.I
got the same result I get with Systat.
> > I can't actually tell which function in R is the
> >
Lavan <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
>
> Hi, I posted this message earlier in "Rmetrics" and I don't know
> whether I posted in the wrong place, so I'm posting it again in
> Rhelp.
>
> I have a function in x and y and let's call it f(x,y). I need to get
> the Hessian matr
Dear List:
In short, I am writing a number of functions as building blocks for
other functions and have some questions about scoping and passing arguments.
Suppose I have functions foo1, foo2, and foo3 such that:
foo1<-function(a=1,b=TRUE,c=FALSE){#do stuff};
foo2<-function(x=1,
Hi all
Is there a function that can find the start and end position of peaks in a
set of numbers.
eg.
x=c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12)
y=somefunction(x)
y
4 14
Thanks
John
[[alternative HTML version deleted]]
__
R-help@r-
It's pretty hard to debug something when all we are told is "it is
giving me an error".
Take a specific example, (e.g. which we know will be dead flat at (0,0),
just as a check). Here's one way to do it:
> fxy <- quote(x^2*log(x^2+y^2+1) + sin(x+y))
> fxy
x^2 * log(x^2 + y^2 + 1) + sin(x + y)
>
It's hard to see how positions 4 and 14 correspond to 'peaks', they look
like troughs to me. So perhaps this is what you mean:
> x <- c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12)
> y <- which(x == min(x))
> y
[1] 4 14
as a function:
somefunction <- function(x) which(x == min(x))
Bill
Hi--
This is a question with a trivial and obvious answer, I'm sure, but I can't
seem to find it in the help files and books that I have handy. I have a
dataframe consisting of two columns, "Gene_Name," a list of gene symbols, and
"Number," a numeric measure of how frequently a tag represent
Hi
Thanks for replying. I meant x[4] is the start of a peak shape and x[14] is
the end of that peak and x[9] is the maxima of the peak.
Thanks,
John
On Mon, Mar 24, 2008 at 11:09 PM, <[EMAIL PROTECTED]> wrote:
> It's hard to see how positions 4 and 14 correspond to 'peaks', they look
> like t
Then the answer is pretty simple: 'no'.
The idea probably needs a lot more refining to make it workable, too.
Why do you discard he peak at 2, with the shape starting at 1 and
finishing at 4, for example?
In thinking about this it might be useful for you to look at signs of
successive differences
John,
There is a peak finding algorithm attributed to Prof. Ripley in the R-help
archive. It has a span parameter which might give you something close to
what you seem to be looking for.
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/33097.html
-Christos
> -Original Message-
> From:
Hi,
Thanks for your reply. I have tried yr suggestions with success. TQVM.
I have another query, say I want to write each cluster into a csv file such
as follows:
clus1 <- my.clusters[[1]]
write.csv(clus1, file = "clus1.csv")
.
.
clus10 <- my.clusters[[10]]
write.csv(clus10,file = "
Hello,
I have a data frame consisting of four columns and would like to sort
based on the first column and then write the sorted data frame to a
file.
> df <- read.table("file.txt", sep="\t")
where file.txt is simply a tab-delimited file containing 4 columns of
data (first 2 numeric, secon
Dear R users
I have a big matrix like
6021118879029011741015199066136288
100714
602110.6580.6880.4740.2620.1630.1370.32
0.2520.206
11880.65810.9170.2450.3310.1220.1480.194
0.1680.171
790
Another approach that involves more infrastructure is to fit a smooth
line to your points, compute the first derivative, and look for change
in sign in the first derivative.
eg
x <- c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12)
smoothed.dx <- predict(smooth.spline(x), deriv=1)$y
which(c(sm
hi thanks,
pls see the code below. the elements of matrix Il should be the derivatives
in matrix h (in Boldface) plus some additional terms, here I did calculate
derivatoves in the matrix, but I want R to calculate it for me.
pid<- function (tau1,tau2,sigma=10,n=100,x_bar=20) {
library(akima)
Hi,
Just to inform you that I found the solution for the write.csv task I
mentioned earlier. Searching thru the r-help leads me to this solution..
###Your soln starts
xx <- max(cl2$cl.kmr10.cluster)
# find out how many clusters there are.
my.clusters <- list(NULL) # set up an empty list for st
Hello,
I'm trying to use the "lsa" (latent semantic analysis) package, and running
into a problem that seems to be related to the number of documents being
processed. Here's the code I'm running (after loading the lsa and rstem
packages), and the error message:
> SnippetsPath <- "c:\\OED\\AuditE
Even in R 2.6.2 the symbol is Rf_KillAllDevices, so this is an rpy
installation issue (one that I cannot reproduce).
Rpy has a mailing list, so why ask here and not there? (In any case, the
convention is that questions about the development version of R should be
asked on the R-devel list.)
81 matches
Mail list logo