Displaying 20 results from an estimated 4000 matches similar to: "Replacing dot with empty space"
2009 Jan 21
1
Two similar zoo objects with different structures, how to get same structure?
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] 1 1 1970
.. .. ..- attr(*,
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,
2010 Feb 24
2
Calling Data frame objects with spaces in their names
Hello I have the following data frame which I read from an EXCEL file, and
when i try to call one of its columns with a space in their names I am not
being able to. For example if I do EURODOLLAR$ED1.Comdty Date I obtain the
following error:
Error: inesperado sÃmbolo en "EURODOLLAR$ED1.Comdty Date"
I have also tried using . or _ instead of the space and have obtained no
succes. How do I
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",
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
2009 Mar 13
2
Taking diff of character vectors
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 changes to SPX9 (there
should be 1 there)?
What if I have a matrix of characters
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",
2009 Sep 21
2
Executing R scripts from another R script
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 the xls file which is in memory.
That is the idea. But I cannot make it work.
First, I do not
2009 Jun 19
1
Need help to optimize a piece of code involving zoo objects
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 makes everything
extremely slow.
I don't know how to optimize the code, but I need to
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
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
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
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
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 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 Mar 30
1
Using split() several times in a row?
Hi, fellow R users.
I have a question about sapply and split combination.
I have a big dataframe (40000 observations, 21 variables). First
variable (factor) is "date" and it is in format "8.29.97", that is, I
have monthly data. Second variable (also factor) has levels 1 to 6
(fractiles 1 to 5 and missing value with code 6). The other 19
variables are numeric.
For each month I
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,
2010 Mar 08
2
Data.frame issue (pls help)
Hi:
I want to obtain a particular value from a data.frame. Following is my
dataframe:
> Quotes
BID ASK
Name
CT2 GOVT 99.92969 99.9375 CT2
TUM0 COMDTY 108.53125 108.5469 TUM0
CT5 GOVT 100.10156 100.1094 GT5
FVM0 COMDTY 115.56250 115.5703 FVM0
TYM0 COMDTY 116.93750 116.9531 TYM0
If I try to run: QuoteTUM0BID = Quotes[Quotes$Name %in%
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.