Hi all,
I feel there is a incompleteness in mAr.est function in mAr package for VAR
estimation. I does not cheak whether there is multicolinearity in data set.
Here I used mAr.est function for following dataset :
head(log(data1)
+ )
V1 V2 V3 V4 V5
Felipe Carrillo wrote:
I can't actually tell which function in R is the
equivalent to TINV function in Excel.
Anyone familiar with that function? Thanks
help.search(t distribution)
I think the quantile function is what you are looking for: qt
Try
qt(pt(5,10),10)
Berend
--
View
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)
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 you
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:
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
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))
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 well:
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
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 return a
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
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
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-project.org
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 to
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
me a
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 can
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]]
__
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 version
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
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
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 :
setClass(A,
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
# 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 comes with any R
installation. There is
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$V1)]
test
V3 v4 V4
1 A R
2
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 24,
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(B,yValue=3)
but this
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 Hodgess
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 | \
[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)
return(.Object)
})
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 coercion
Is anyone aware
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
Is anyone aware of a way around
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(tclvalue(b))
[1] NA
Warning message:
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
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
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 look as
[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 was more
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 R version
*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
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
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
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] [,2]
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
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
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
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 matrix. i.e I
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};
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]]
__
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 representing
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
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
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, second 2
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
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
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
67 matches
Mail list logo