search for: sergeyg

Displaying 20 results from an estimated 38 matches for "sergeyg".

Did you mean: sergey
2007 Feb 27
1
Additional args to fun in integrate() not found?
...place is not a multiple of replacement length 5: number of items to replace is not a multiple of replacement length ------------------------------- Do I get these warnings because I define cdf as a matrix and the output-cdf is a list? Please, help me with these! Email to my gmail account, please: sergeyg at gmail.com THanks in advance Sergey
2010 May 20
2
Deleting a file on a drive from within R
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
2009 Sep 21
3
Putting a text box in a plot
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 where I found it. Could anyone help out? Thank you in advance! Sergey -- Kniven sk?rpes bara
2009 Sep 22
3
Function similar to cumsum/cumprod
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 observations Then I add one observation and calculate mean of 31 observations Then I add one more observation
2009 Feb 03
1
Automatic creation of columns in zoo object
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, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465,
2007 Feb 22
2
Combining tapply() and cor.test()?
Hello, fellow R-users. Let me describe the setup first. I have a data.frame, a sample of which is reported below: Company.Name Periods Returns MFR.Factor 350 Wartsila Oyj A 1996-07-31 6.82 0.02 351 Custodia Holding AG 1996-07-31 4.15 -0.02 352 Wartsila Oyj 1996-07-31 7.73 0.09 353 GEA Group AG
2010 Mar 31
2
Simplifying particular piece of code
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="IYC.AV120",
2007 Sep 12
1
Integrate() error message, I am at a loss
...yone suggest me what is wrong with my function? These are the examples of function calls that work OK: nctspa(a=1:10,n=5) nctspa(a=1:10, n=5, mu=2, theta=3, renorm=0) This does not work: nctspa(a=1:10, n=5, mu=2, theta=3, renorm=1) Many thanks in advance for your help! please, send reply also to sergeyg at gmail.com /Sergey Here is the function: #Computes the s.p.a. to the doubly noncentral t at value x. #degrees of freedom n, noncentrality parameters mu and theta. #==========================================================# nctspa <- function(a,n,mu=0,theta=0,renorm=0,rec=0){ #Pass renorm=1...
2008 Mar 22
1
Vectorization Problem
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 of Gauss Copula rho <- 0.5 #corr R <- rbind(c(1,rho),c(rho,1)) #vcov matrix id <-
2008 Aug 10
1
Again question about filter()
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.10000 6.71000 9.22100 15.87710 21.45821 28.66037 41.08274 55.83522 74.51437 100.78197 If I understand it correctly, the time
2010 Aug 05
1
Extracting future and past workday dates
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.
2007 Sep 28
1
Converting to mode numeric within a matrix
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 mode character, despite the attempt to convert it to
2009 Jan 21
1
Looking for a special date function in R
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.1999 02.08.1998 06.03.1999 06.09.1998 I am working with a zoo object where the row names are dates and for
2009 Feb 10
1
Replacing dot with empty space
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
2009 Feb 27
1
Problem with RBloomberg (not the usual one)
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 <- blpConnect(show.days="week", na.action="previous.days",
2010 Mar 03
1
Finding a date 6 months before
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 you know you don't know.
2008 Jan 25
2
How does do.call() work??
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 in do.call() help file this sentence: "The behavior of some functions, such as
2010 Feb 08
2
Physically open Excel file from R
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 VBA code on open, so all I need to do is physically open it (no reading/writing at all). I wonder if
2007 Feb 26
1
Automated figure production
Hello, everybody Two questions: 1) I am new to maillists, and particularly to r-help maillist. Where specifically do I go online to see my question and answers to it??? If I use the searchable archives, or archives by Robert King, I see my question but not the answers, though I know that at least one persion posted the answer to r-help. Why do not I see the answers? 2) I need to produce 104
2009 Feb 11
2
Question about apply()
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, 1639.9, 1696.4, 1710.9, 1690.2, 1677.9, 1694.4, 1713.9, 1713.9, 1705.4, 1708.4, 1692.9, 1689.6,