Gabor, David, thank you.
David, your last suggestion is what I need.
Regards,
Sergey
On Mon, Sep 6, 2010 at 16:12, David Winsemius wrote:
>
> On Sep 6, 2010, at 9:56 AM, Sergey Goriatchev wrote:
>
>> Hello everyone.
>>
>> Say we have the following:
>>
>&
Hello everyone.
Say we have the following:
a <- matrix(c(-75, 3, 5, 9, 2, 3, 5), nrow=1, dim=list("06092010",
c("ES", "PT", "Z ", "CF", "GX", "ST", "EO")))
b <- matrix(c(-5, 2, 4, 12, 5), nrow=1, dim=list("06092010", c("PT",
"CF", "AT", "EM", "ST")))
d <- cbind(a, b)
I want to calculate sums of
Henrique, that is what I need!
Big thanks!
Regards,
Sergey
On Thu, Aug 5, 2010 at 14:56, Henrique Dallazuanna wrote:
> n <- 3
> w <- as.numeric(format(Sys.Date(), '%w'))
> fut <- c(Sys.Date() - 0:(n + ifelse(w - n > 6, (w - n) - 6, 0)),
> Sys.Date() + 1:(n + 1 + ifelse(w + n > 6, (w + n
Thank you David, will check it out, as I use chron and zoo!
Regards,
Sergey
On Thu, Aug 5, 2010 at 14:29, David Winsemius wrote:
>
> On Aug 5, 2010, at 8:09 AM, Sergey Goriatchev wrote:
>
>> Hi, Henrique
>>
>> Thank you for trying, but that is not what I want.
> or
>
> 0:3 %*% matrix(c(1, -1), ncol = 2) + Sys.Date()
>
> On Thu, Aug 5, 2010 at 8:36 AM, Sergey Goriatchev wrote:
>>
>> Hello everyone
>>
>> I need to extract a vector of (t-3) to (t+3) dates, only working days.
>> How can I do that?
>>
>>
Hello everyone
I need to extract a vector of (t-3) to (t+3) dates, only working days.
How can I do that?
For today I need a vector:
10.08.210
09.08.2010
06.08.2010
05.08.2010
04.08.2010
03.08.2010
02.08.2010
Regards,
Sergey
--
Kniven skärpes bara mot stenen.
___
at 10:31 AM, Sergey Goriatchev wrote:
>
>> Hello, everyone
>>
>> F# is now public. Compiled code should run faster than R.
>>
>> Anyone has opinion on F# vs. R? Just curious
>>
>> Best,
>> S
>
>
> The key time critical parts of R are writte
Hello, everyone
F# is now public. Compiled code should run faster than R.
Anyone has opinion on F# vs. R? Just curious
Best,
S
--
---
Kniven skärpes bara mot stenen.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-he
John, Steve, thank you for answering my post!
On Wed, Jun 16, 2010 at 20:55, Steve Lianoglou
wrote:
> Hi,
>
> I think I lost the reference email somewhere, but:
>
>> Not only is the sequential foreach much slower than the simple
>> for-loop (as least in this particular instance), but I am not qui
Thank you, Mario.
On Wed, Jun 16, 2010 at 14:51, Mario Valle wrote:
>
>
> On 15-Jun-10 17:07, Sergey Goriatchev wrote:
>>
>> Hello,
>>
>> I am reading "Using The foreach Package"
Hello,
I am reading "Using The foreach Package" document and I have tried the
following:
-
> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32
locale:
[1] LC_COLLATE=German_Switzerland.1252
LC_CTYPE=German_Switzerland
> showMethods("apply")
Function: apply (package base)
X="ANY"
X="missing"
(inherited from: X="ANY")
X="timeSeries"
On Tue, Jun 15, 2010 at 15:10, Gavin Simpson wrote:
> On Tue, 2010-06-15 at 14:56 +0200, Sergey Goriatchev wrote:
>
s article discusses what to do at this point.
>
> HTH
>
> G
>
>>
>> ---
>> My machine:
>> platform i386-pc-mingw32
>> arch i386
>> os mingw32
>> system i386, mingw32
>> status
>> major 2
6
os mingw32
system i386, mingw32
status
major 2
minor 10.1
year 2009
month 12
day14
svn rev50720
language R
version.string R version 2.10.1 (2009-12-14)
On Tue, Jun 15, 2010 at 14:26, Erik Iverson wrote:
>
Hello,
If I want to see how, say, apply function is written, how would I be
able to do that?
Just typing "apply" at the prompt does not work.
Thank you for help!
Sergey
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
| 972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> --
>
>
>
>
> On Thu, May 20, 2010 at 11:46 AM, Sergey Goriatchev
&g
Thank you, Dave!
Regards,
Sergey
On Thu, May 20, 2010 at 10:55, Dave Deriso wrote:
> file_to_delete = file.choose()
> file.remove(file_to_delete)
>
> Best,
> Dave Deriso
> UCSD Psychology
>
> On Thu, May 20, 2010 at 1:46 AM, Sergey Goriatchev wrote:
>> Hello,
&
Hello,
I have an Excel file on a drive and I extract data from it into R session.
Once I have extracted the data, I want to delete that Excel file from the drive.
Can I do that from within R, please?
Thank you for help!
Regards,
Sergey
__
R-help@r-pro
2009-06-30
> 2 5 8 9
>
>
> On Thu, Apr 8, 2010 at 11:18 AM, Sergey Goriatchev wrote:
>> Hello, everyone
>>
>> I have the following problem:
>> Say I have an irregular zoo timeseries like this:
>>
>> a <- zoo(rep(1
Hello, everyone
I have the following problem:
Say I have an irregular zoo timeseries like this:
a <- zoo(rep(1:9), as.Date(c("2009-03-20", "2009-03-27", "2009-04-24",
"2009-04-25", "2009-04-30", "2009-05-15", "2009-05-22", "2009-05-29",
"2009-06-26")))
and I have regular zoo timeseries like this
Thanks for help, Gustaf!
(Kan man säga "man tackar" oxa?) :-)
On Wed, Mar 31, 2010 at 17:34, Gustaf Rydevik wrote:
> On Wed, Mar 31, 2010 at 5:11 PM, Sergey Goriatchev wrote:
>> but
>>
>> data <- merge(data,data.list)
>>
>> works.
>>
>>
Hello, everyone
I have a piece of code that looks like this:
mrets <- merge(mrets, BMM.SR=apply(mrets, 1, MyFunc, ret="BMM.AV120",
stdev="BMM.SD120"))
mrets <- merge(mrets, GM1.SR=apply(mrets, 1, MyFunc, ret="GM1.AV120",
stdev="GM1.SD120"))
mrets <- merge(mrets, IYC.SR=apply(mrets, 1, MyFunc, ret
Hello everyone,
I have versions 2.7.2 and 2.10.1 installed on a machine that has no
access to internet.
In 2.7.2 I can use ? to get help on functions, which in 2.10.1 that
does not work, all I see is "starting httpd help server...done" and
then nothing.
Have I downloaded 2.10.1 incorrectly (=forg
t; "%d"))
>> window(z, index = ago6mos)
> 2009-09-03
> 94
>
> If we are at the last day of the month and 6 months ago that month has
> fewer days than today's month then what to do is not well defined but
> we resolve that here by just moving ahead
Hello everyone
I use zoo objects and I need to find a date 6 months before today's date.
Example, today we have 3rd March 2010, I need to find the date 3rd
September 2009.
How could I do that, please?
Regards,
Sergey
--
Simplicity is the last step of art./Bruce Lee
The more you know, the more
;
>
> On 08.02.2010 13:48, Sergey Goriatchev wrote:
>>
>> Hello, everyone
>>
>> I wonder if it is possible to PHYSICALLY open an Excel file from R.
>> The reason I ask is, I produce regularly an Excel file in R, and then
>> I want to make it look good, so
Hello, everyone
I wonder if it is possible to PHYSICALLY open an Excel file from R.
The reason I ask is, I produce regularly an Excel file in R, and then
I want to make it look good, so I have a VBA routine in another Excel
file that works on the regular Excel file.
This formatting file executes V
Great! Thank you, Romain!
On Thu, Dec 3, 2009 at 11:33, Romain Francois
wrote:
> ?file.exists
>
> On 12/03/2009 11:31 AM, Sergey Goriatchev wrote:
>>
>> Hello, everyone
>>
>> How would I check in R if a particular file (Excel file) is in a
>> particula
Hello, everyone
How would I check in R if a particular file (Excel file) is in a
particular folder on a particular drive?
I am writing a piece of code around that file, using xls.open() in
xlsReadWritePro to open the file in memory and use it. But before I
try to open the file I want to catch the
gt; > temp - zoo(coredata(temp.m), dt.lag)
> 2009-10-05 2009-10-06 2009-10-07 2009-10-08 2009-10-09 2009-10-13
> 2009-10-14
>-5 -6 3 2 -2 2 1
>
>
> On Wed, Oct 14, 2009 at 10:39 AM, Sergey Goriatchev
> wrote:
>
Hello everyone.
I have a specific problem that I have difficulties to solve.
Assume I have a zoo object:
set.seed(12345)
data <- round(runif(27)*10+runif(27)*5, 0)
dates <- as.Date(c("09/03/09", "09/04/09", "09/07/09", "09/09/09",
"09/10/09", "09/11/09", "09/14/09", "09/16/09", "09/17/09",
"09/18
Henrique, thank you!
On Tue, Sep 22, 2009 at 16:32, Henrique Dallazuanna wrote:
> Try this;
>
> set.seed(123)
> x <- rnorm(100)
> sapply(30:length(x), function(i)mean(x[1:i]))
>
> On Tue, Sep 22, 2009 at 11:12 AM, Sergey Goriatchev wrote:
>> Hello, everyone
&
Hello, everyone
I wonder if there is in R somewhere a function similar to cumsum().
The function calculates a statistic (say mean or standard deviation)
buy adding consequtively one more data point.
So, say I have a timeseries of 100 observations.
I start by calculating mean of first 30 observati
Hello, Jim
Thank you a lot for suggestions, I will check that package out. It
could be the one I used way back then! :-)
Best,
Sergey
On Tue, Sep 22, 2009 at 01:55, Jim Lemon wrote:
> On 09/21/2009 07:42 PM, Sergey Goriatchev wrote:
>>
>> Hello everyone,
>>
>> I have
17:52, Sergey Goriatchev wrote:
> Hello, everyone
>
> I run Eclipse Ganymede and R 2.7.2 at work.
> I have one R script file where I open in memory a new xls file (using
> xlsReadWritePro), call other R scripts, which are in the same folder
> as the main R script,
> which get
Hello, everyone
I run Eclipse Ganymede and R 2.7.2 at work.
I have one R script file where I open in memory a new xls file (using
xlsReadWritePro), call other R scripts, which are in the same folder
as the main R script,
which get data from an existing xls file, process data, and output
results in
out a reproducible example.
>
>
> baptiste
>
>
>
> 2009/9/21 Sergey Goriatchev :
>> Hi, Baptiste
>>
>> Yes, I've found textplot() function, but I doubt it is the one I need.
>> What I have is a density plot, and I want to add to this density plot
>&g
ckage?
>
> HTH,
>
> baptiste
>
> 2009/9/21 Sergey Goriatchev :
>> Hello everyone,
>>
>> I have a plot and I want to but a (formatted) box containing text and
>> numbers, say:
>> Mean: 0.1
>> St.Deviation: 1.1
>> Skewness: 1.1
>> K
Hello everyone,
I have a plot and I want to but a (formatted) box containing text and
numbers, say:
Mean: 0.1
St.Deviation: 1.1
Skewness: 1.1
Kurtosis: 0.5
I know there is a way to do this, there is a function in some library,
but it's been years since
I used this function, and I do not remember
ly not what you want.
> It has the same effect as
>
> func <- function(x, j) x[72+j] + [144+j]
>
> On Wed, Jul 15, 2009 at 9:26 AM, Sergey Goriatchev wrote:
>> Hello everyone,
>>
>> Say I have defined a convenience function in my code like this:
>>
>>
Hello everyone,
Say I have defined a convenience function in my code like this:
func <- function(x, j){
x[168+j] <- x[72+j]+x[144+j]
}
And now I apply it to some columns in a big zoo object like this:
for (m in 1:24){
combined <- merge(combined, LA1sum=apply(combined, 1, func,
wrote:
> One additional thought. If the reason you want to do that is
> just so that you can see the last few rows more easily then
>
> tail(Data)
>
> will display the last few rows or tail(Data, 10) will display
> the last 10 rows.
>
> On Thu, Jul 9, 2009 at 7:36 AM, Ser
Hi, Gabor
Thank you!
That is exactly what I did, even before your email. :-)
Regards,
Sergey
On Thu, Jul 9, 2009 at 12:52, Gabor Grothendieck wrote:
> To display that object in reverse time order try this:
>
> as.data.frame(Data)[nrow(Data):1, ]
>
>
> On Thu, Jul 9, 2009
Hello everyone,
Say I have zoo object
x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1
x <- zoo(rnorm(5), x.Date)
y <- zoo(rt(5, df=2), x.Date)
z <- zoo(rt(5, df=5), x.Date)
Data <- merge(x,y,z)
What should I do to make the latest values appear at the top?
Thank you for your help!
Rega
te:
> check out 'filter' to see if it does what you want with the 'recursive'
> option.
>
> On Fri, Jun 19, 2009 at 3:33 AM, Sergey Goriatchev
> wrote:
>>
>> Hello, everyone
>>
>> I have a long script that uses zoo objects. In this script I used
away).
Do you think this is correct way to do this, or have I missed something?
Regards,
Sergey
On Fri, Jun 19, 2009 at 15:23, jim holtman wrote:
> check out 'filter' to see if it does what you want with the 'recursive'
> option.
>
> On Fri, Jun 19, 2009 at 3:33 A
(Sorry, sent the message before I finished it)
Hello, everyone
I have a long script that uses zoo objects. In this script I used
simple moving averages and these I can very efficiently calculate with
filter() functions.
Now, I have to use special "exponential" moving averages, and the only
way I c
Hello, everyone
I have a long script that uses zoo objects. In this script I used
simple moving averages and these I can very efficiently calculate with
filter() functions.
Now, I have to use special "exponential" moving averages, and the only
way I could write the code was with a for-loop, which
http://about.bloomberg.com/contact_softwaresupport_upgr.html
>
> Good luck.
>
> Kent
>
>
> -Original Message-
> From: Sergey Goriatchev [mailto:serg...@gmail.com]
> Sent: Friday, February 27, 2009 1:54 AM
> To: r-sig-fina...@stat.math.ethz.ch; r-help@r-project.org
> Subject: Re:
d(nm2, nm3)
> temp<-as.data.frame(sapply(1:ncol(matr), function(.col) {
> -1.0*c(0,as.numeric((head(matr[,.col],-1) != tail(matr[,.col],-1
> }))
> cbind(matr,temp)
>
>
>
> On Fri, Mar 13, 2009 at 5:24 AM, Sergey Goriatchev wrote:
>> Hello, everybody
>>
>&
Hello, everybody
Say I have
nm1 <- c(rep(1,10), rep(0,10))
then I can do:
diff(nm1)
to see where I have shift in value
but what if I have
nm2 <- c(rep("SPZ8", 10), rep("SPX9", 10))
how can I produce the same ouput as diff(nm1) does, that is zeros
everywhere except for one place where SPZ8 change
bline(v =
> time(s)[s > 0], col = "green") }
> plot(cbind(x, s), panel = p)
>
> There are further examples of panel functions in the examples section
> of ?plot.zoo
> in case what you want is a variation of the above.
>
>
> On Tue, Mar 3, 2009 at 9:04 AM
14:44, Gabor Grothendieck
wrote:
> Do you mean you want to shade a portion of the plot?
>
> There are two examples of that in the examples section of ?plot.zoo
> and a further example using xyplot.zoo in the examples section of
> ?xyplot.zoo
>
> On Tue, Mar 3, 2009 at 8:37
), screen = c(1, 1, 2), type = c("p", "l", "l"),
> col = list(ifelse(s > 0, "green", "red"), 1, 1), pch = 20)
>
>
>
> On Tue, Mar 3, 2009 at 7:48 AM, Sergey Goriatchev wrote:
>> Hello, everyone
>>
>> I have a z
Hello, everyone
I have a zoo object containing several time series of daily frequency.
One of these timeseries is an indicator function with value (-1) at
certain times, and (+1) at the other.
I do a plot of several of the timeseries in one go (a multiple plot).
I wonder if I can automatically in
???
Best,
Sergey
On Fri, Feb 27, 2009 at 09:16, Sergey Goriatchev wrote:
> Hello, everyone!
>
> I have a problem with RBloomberg and this is not the usual "no
> administrator rights" problem.
>
> I have R 2.7.2, RBloomberg 0.1-10, RDCOMclient 0.92-0
>
> RDCOMCli
Hello, everyone!
I have a problem with RBloomberg and this is not the usual "no
administrator rights" problem.
I have R 2.7.2, RBloomberg 0.1-10, RDCOMclient 0.92-0
RDCOMClient, chron, zoo, stats: these packages load OK.
Then, trying to connect, I get following error message:
conn <- blpConn
y be used instead.
>
> If you did want to use embed then unzoo data first but
> that will lose the time index so add it back in later:
>
> e <- embed(coredata(data),2)
> dif <- zoo(e[, 1:4] / e[, 5:8] - 1, time(data)[-1])
> cbind(data, dif)
>
> On Wed, Feb 11, 2009 at
ecify a new variable (with suffix ."ret") within merge() function.
Kind Regards,
Sergey
On Wed, Feb 11, 2009 at 13:47, Peter Dalgaard wrote:
> Sergey Goriatchev wrote:
>> Hello, everyone!
>>
>> Assume you have this data:
>> data <- structure(c(66.609375,
13:34, Gabor Grothendieck
wrote:
> See ?diff.zoo
>
> dif <- diff(data, arithmetic = FALSE) - 1
> cbind(data, dif)
>
> On Wed, Feb 11, 2009 at 6:21 AM, Sergey Goriatchev wrote:
>> Hello, everyone!
>>
>> Assume you have this data:
>> data <- stru
Hello, everyone!
Assume you have this data:
data <- structure(c(66.609375, 67.09375, 66.40625, 66.734375, 67.109375,
66.875, 66.09375, 65.921875, 66.546875, 66.140625, 66.140625,
65.65625, 65.875, 65.59375, 65.515625, 66.09375, 66.015625, 66.140625,
66.109375, 66.421875, 1702.7, 1647.7, 1649.4, 16
Thanks, Gabor.
You are always very helpful.
On Tue, Feb 10, 2009 at 12:42, Gabor Grothendieck
wrote:
> Also, try these alternatives:
>
> sub(".", " ", x, fixed = TRUE)
> chartr(".", " ", x)
>
>
> On Tue, Feb 10, 2009 at
OK, got it now:
sub("[.]", " ", "ED4.Comdty")
On Tue, Feb 10, 2009 at 10:01, Sergey Goriatchev wrote:
> Hello, everyone
>
> How do I replace dot with empty space in "ED4.Comdty"?
> I need to get "ED4 Comdty"
> tried sub() in many
Hello, everyone
How do I replace dot with empty space in "ED4.Comdty"?
I need to get "ED4 Comdty"
tried sub() in many different ways, like sub({.}, " ", "ED4.Comdty")
etc but could not do it.
Thanks in advance,
Sergey
__
R-help@r-project.org mailing li
x(0, nrow(me.la), length(nms), dimnames = list(NULL, nms))
> cbind(me.la, zeromat)
>
> In this case zeromat and me.la have the same dimensions so we could
> alternately reduce it to this slightly briefer code:
>
> zeromat <- 0 * me.la
> colnames(zeromat) <- sub(".Comdty&quo
a have the same dimensions so we could
> alternately reduce it to this slightly briefer code:
>
> zeromat <- 0 * me.la
> colnames(zeromat) <- sub(".Comdty", "tr", me.la.tickers)
> cbind(me.la, zeromat)
>
>
> On Tue, Feb 3, 2009 at 8:44 AM,
Hello, everyone
I have a question.
Assume I have the following zoo object:
me.la <- structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5,
1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75,
1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75,
1483.75, 1468.75, 145
1-14
> 1 2 3
>
> On Wed, Jan 21, 2009 at 10:51 AM, Sergey Goriatchev wrote:
>> Dear Dr. Grothendieck,
>>
>> First of all, I realized I did not load zoo package before I tried the
>> first str(bldata). If I load zoo and then do str(bldata)
t;01/08/09" "01/09/09" "01/12/09" "01/13/09" "01/14/09"
"01/15/09" "01/16/09" "01/19/09"
That is not the same structure, attributes disappeared.
What am I doing wrong?
Thank you in advance for your help.
Reg
Dear all,
I have a zoo object that has following structure:
> str(bldata)
zoo [1:5219, 1:12] 91.9 91.8 91.7 91.8 91.7 ...
- attr(*, "index")=Classes 'dates', 'times' atomic [1:5219] 7305
7306 7307 7308 7309 ...
.. ..- attr(*, "format")= chr "m/d/y"
.. ..- attr(*, "origin")= Named num [1:3]
uot;2009-07-21"
>
>
> On Wed, Jan 21, 2009 at 6:27 AM, Sergey Goriatchev wrote:
>> Dear Gabor,
>>
>> Thanks for that!
>> Still, it is not really similar to how EDATE works.
>> With julian(Sys.Date(), Sys.Date() - 10) one moves 10 days back.
>> The
Jan 2009, Sergey Goriatchev wrote:
>
>> Dear Gabor,
>>
>> Thanks for that!
>> Still, it is not really similar to how EDATE works.
>> With julian(Sys.Date(), Sys.Date() - 10) one moves 10 days back.
>> The problem is that I need to move by months, not by days,
?julian
>
>> julian(Sys.Date(), Sys.Date() - 10) # 10
> [1] 10
> attr(,"origin")
> [1] "2009-01-11"
>
> and R News 4/1.
>
> On Wed, Jan 21, 2009 at 4:37 AM, Sergey Goriatchev wrote:
>> Hello, everyone
>>
>> I wonder if R has something s
Hello, everyone
I wonder if R has something similar to Excel function
EDATE(start_date; months) which returns a serial number of the date
that is the indicated number of months before of after the start date.
Example (the second column EDATE(first_column; -6)):
01.01.1999 01.07.1998
02.02.199
4:33 PM, Prof Brian Ripley
<[EMAIL PROTECTED]> wrote:
> Most internationalized programs (including R) respond to the LANGUAGE
> environent variable: have you tried setting it to "en"?
>
> We would need to know your OS to help more (it looks like it might be
> Windows
Hello,
I am running R in Eclipse, and when I start Eclipse or when I get
error messages, they are in German.
(My computer's regional language settings are German.) Is there a way
to switch to English in Eclipse
without changing my global regional language settings? In basic R GUI
this is possible
Hello,
I thought I understood filter() with the help from Prof. Grothendieck,
but I guess I did not.
For example, how does this work:
filter(1:10, c(0.1, 0.5, 1, 0.5), "recursive", init=c(1,2,3,4))
Time Series:
Start = 1
End = 10
Frequency = 1
[1] 7.1 6.71000 9.22100 15.87710 21.458
Hello,
I cannot understand what filter() function in package stat is doing.
For example, what does filter(1:100, c(1,1,1)) mean?
Could someone please explain? Help file is not enough for me.
Thanks in advance.
Sergey
__
R-help@r-project.org mailing lis
I have the code for the bivariate Gaussian copula. It is written with
for-loops, it works, but I wonder if there is a way to vectorize the
function.
I don't see how outer() can be used in this case, but maybe one can
use mapply() or Vectorize() in some way? Could anyone help me, please?
## Density
Dear members of R forum,
Say I have a list:
L <- list(1:3, 1:3, 1:3)
that I want to turn into a matrix.
I wonder why if I do:
do.call(cbind, L)
I get the matrix I want, but if I do
cbind(L)
I get something different from what I want. Why is that? How does
do.call() actually work?
I've read
that's the bvnpdf() code:
bvnpdf <- function(xy, mu, Siginv, detSig){
f<-numeric()
x <- xy[[1]]
if(xy[[1]]>xy[[2]] & (1==2)) {
f <- 0} else {
v <- rbind(xy[1], xy[2])
e <- t(v-mu) %*% Siginv %*% (v-mu)
f <- as.numeric(
Hello, I am trying to compute rectangle probability of bivariate
normal distribution with the following function:
bvnrectangle <- function(mu, Sig, xmin, xmax, ymin, ymax){
library(adapt)
Siginv <- solve(Sig)
detSig <- det(Sig)
areal <- adapt(ndim=2, lower=c(xmin,ymin), upper=c(xmax,ymax),
minpts=
Dear R users,
I have following code, estimating Poisson log-likelihood a number of times:
poisson.loglik <- function(mu, y){
n <- NROW(y)
logl <- sum(y)*log(mu)-n*mu
return(-logl)
}
estimates <- numeric(1e5)
for(i in seq_along(estimates)){
estimates[i] <- optim(par=1, poisson.lo
Hello,
I have R2.6.0 installed on my laptop (Vista), and I create my scripts in WinEdt.
Today I installed R on a stationary PC which runs Windows XP Professional, SP2.
For some reason, the script I wrote on my laptop does not run on the
stationary machine. I reinstalled R but to no avail.
Problem
THanks, Chuck!
I figured it out already, these were not row numbers at all! It just
counted down along the columns.
On 10/23/07, Charles C. Berry <[EMAIL PROTECTED]> wrote:
> On Tue, 23 Oct 2007, Sergey Goriatchev wrote:
>
> > Hello,
> >
> > I have a question
Hello,
I have a question regarding the following output:
> database <- read.delim(file=path.input.file, header=TRUE, dec=".", sep="\t",
> na.strings = "#NV")
> str(database)
'data.frame': 314 obs. of 13 variables:
$ S : Factor w/ 314 levels "307073","400212",..: 147 72 299 137
162 62
Hello,
Let me describe what I have and what I want to do:
I have two (7x6) matrices (call them A and B) that have same row and
column names (rows=species, columns=variables) but contain numerical
values that differ (same experiment done twice and values calculated
and put in different matrices).
Hello,
I have following problem.
I produce a histogram of some values and in the plot area I create 2
text boxes - one with names of statistics and one with values of these
statistics. Coded like that:
ht <-hist(x, )
...
ameant <-ameant <- paste("Ar.Mean")
...
amean <- round(mean(x), digits=
Hello,
I create a matrix:
best <- matrix(0, ncol=2, nrow=num.selected,
dimnames=list(the.best$.Name, c("Probability(%)", "Inside")))
best[,1] <- as.numeric(the.best$Total*100)
best[,2] <- ifelse(the.best$Weight==0, "No", "Yes")
What I want is the second column of mode numeric, but it is of mod
Hello,
For my functions I want to create output similar in appearance to that
of what you get when you print a summary of lm model:
Residuals:
Min1Q Median3Q Max
-0.209209 -0.043133 0.001793 0.044105 0.234750
Coefficients:
Estimate Std
Hello,
I have a problem finding a root of a function, which I define like this:
tuki <- function(u, x, a, lambda){
if((lambda%%1>0) & u<0) {u<-(u+0i)}
f <- Re(x-(a*(u)^lambda-(1-(u))^lambda)/lambda)
f
}
What I want to do is to find the root, but without specifying the
interval within which to se
Hello, everybody
I have R 2.5.1 now installed on a laptop with Windows Vista Home
Premium. I have problems updating the packages. Here is what I get at
the prompt when I try to update:
> update.packages(ask='graphics')
--- Please select a CRAN mirror for use in this session ---
trying URL 'http:
Hello!
I have a problem with integrate() in my function nctspa(). Integrate
produces an error message "evaluation of function gave a result of
wrong length". I don't know what that means. Could anyone suggest me
what is wrong with my function?
These are the examples of function calls that work OK
Hello!
I have a problem with integrate() in my function nctspa(). Integrate
produces an error message "evaluation of function gave a result of
wrong length". I don't know what that means. Could anyone suggest me
what is wrong with my function?
These are the examples of function calls that work OK
94 matches
Mail list logo