Displaying 20 results from an estimated 300 matches similar to: "plotting"
2007 Oct 16
1
underdetermined system
Hi, sorry, I'm an idiot.. and I know I'm missing something stupid..
I thought if we solve an underdetermine system with QR, my soln is:
min ||x|| (L2 sense) such that Ax = b
then say i have:
> w <- matrix(c(1, 5), ncol=2)
> sw = 2
> qrW = qr(t(w) %*% w)
> qr.coef(qrW, t(w) %*% sw)
[,1]
[1,] 2
[2,] NA
but we also have soln (0, 2/5) which obviously has a
2007 Mar 01
3
Simplest question ever...
Let's say i have
a = c(1, 4, 5)
b = c(2, 6, 7)
and i have matrix m, what's an efficient way of access
m[1, 2], m[4, 6], m[5, 7]
like of course m[a, b] = is not going to do, but what's an expression that
will allow me to have that list?
Thanks!
--
View this message in context: http://www.nabble.com/Simplest-question-ever...-tf3329894.html#a9258932
Sent from the R help mailing list
2007 Aug 28
2
Efficient way to parse string and construct data.frame
Hi all,
I have this list of strings
[1] "1 ,2 ,3" "4 ,5 ,6"
Is there an efficient way to convert it to data.frame:
V1 V2 V3
1 1 2 3
2 4 5 6
Like I can use strsplit to get to a list of split strings.. and then use say
a = strsplit(mylist, ",")
data.frame(V1 = lapply(a, function(x){x[1]}), V2 = lapply(a,
function(x){x[2]}),.....)
but i'm
2007 Jun 28
2
restructuring matrix
Hi all,
let's say I have matrix
People Desc Value
Mary Height 50
Mary Weight 100
Fanny Height 60
Fanny Height 200
Is there a quick way to form the following matrix?
People Height Weight
Mary 50 100
Fanny 60 200
(Assuming I don't know the length of people/desc and let's say these are
characters matrix.. I tried
2006 Nov 13
1
Fetching Intraday data from Bloomberg
Hi Everyone.
I am downloading intraday Bloomberg data from R.
The code I give is:
library(zoo)
library(chron)
library(RBloomberg)
conn<-blpConnect(show.days="trading",na.action="previous.days",periodici
ty="daily")
dat<-blpGetData(conn, "VG1 Index", c("LAST_PRICE"),
start=as.chron(as.Date("2006-9-01",
2008 Nov 11
2
Manipulation in timeSeries object:how to use the function "applySeries" by daily?
Hi all
I have some tick-by-tick data and I have calculated the intraday returns. I
want to sum up the intraday squared returns to calculate the daily
volatility(or daily variance). I know that the s-plus FinMerics has the
function aggregateSeries function that can be apply to daily data:
aggregateSeries(x, Fun, by="daily"), but the counterpart function in
R:applySeries can not be apply
2011 Jul 19
1
Plotting intraday data in quantmod
Hello, I'm new to R and am having trouble plotting intraday data on a chart.
I haven't had any success with using ideas from some other posts or other
content.
My data is in csv format, here's the first few rows:
TimeStamp..UTC. Open High Low Close
1 2011-06-15 13:30:00:0000 127175 127500 126925 127425
2 2011-06-15 14:00:00:0000 127400 127575 127225 127225
3 2011-06-15
2008 Mar 22
2
intraday OHLC plot
I want to create a open/high/low/last plot of intraday data.
I try to use the function plotOHLC from the tsteries package. I create
my own multiple time series and then try to plot it.
raw Data Format (file eurusd2.csv):
"Date (GMT)" "Open" "High" "Low" "Last"
17-03-2008 00:00:00 1,5764 1,5766 1,5747 1,5750
17-03-2008 00:05:00 1,5749 1,5750 1,5741
2011 Jul 26
1
intraday plot and gaps in data
Hi,
I have an intraday timeseries of financial data (see below) which has gaps
due to market opening and closing hours. I am trying to plot it, but the
time gap is always visible in the plot. I tried converting data to xts, zoo,
timeSeries and plotting it with different functions i.e. plot.xts, plot.zoo.
The only way to make it work was with function 'chartSeries' in the quantmod
package
2006 Nov 22
1
RBloomberg Multi-ticker problem
Hi,
I am trying to download data from Bloomberg through R. If I try to
download intraday data for multiple tickers and only one field, I get
the error, written below in red. How do I get rid of this error?
> dat<-blpGetData(conn, c("NOK1V FH Equity","AUA AV Equity"),
"LAST_PRICE",
2010 Feb 22
2
Creating regularly spaced time series from irregular one
Hello,
I have a series of intraday (high-frequency) price data in the form of POSIX
timestamp followed by the value.
I sucesfuly loaded that into "its" package object. I would like to create
from it a regularly spaced time series of prices (for example 1min, 5min,
etc apart) so i could calcualte returns.
There is an interpolation function locf() that for timestamp with value NA
uses last
2009 Apr 27
1
Extract one element from yahooKeystats data
I am trying to extract one particular piece of data(Float) from all
the data returned by yahooKeystats, but thus far I'm having no luck.
This is what I've got so far:
> library(fImport)
Loading required package: timeSeries
Loading required package: timeDate
> data<-yahooKeystats("IBM")
trying URL 'http://finance.yahoo.com/q/ks?s=IBM'
Content type 'text/html;
2012 Apr 07
2
newbie question: strategy
newbie to R, less than a week, and I ordered some books about R, but I learn
better by examples.. and thus far I cant find a good example of what I am
trying to do... which follows:
assuming one is using any instrument intra-day data... I want to..
open a file (lets name it signal) that will contain two fields...
date/time(MM/DD/YYYY HH:MM) and signal (1=buy,-1=sell)
open a file with real time
2010 Dec 03
1
intraday zoo
I'm trying to read intraday zoo but running into issues (again) ...
what am I missing here? (the date doesn't seem to read in correctly)
> head(dat)
TrdDate TrdTime impliedVol
1 20090102 09:55:03 0.3610715
2 20090102 09:55:04 0.3637943
3 20090102 09:55:05 0.3752375
4 20090102 09:55:05 0.4190025
5 20090102 09:55:06 0.3696080
6 20090102 09:55:06 0.4944981
> f <-
2005 Mar 24
5
Bloomberg data import
Dear R Folks,
I know that Enrique Bengoechea ( Credit Suisse ) had posted some code
snippets for importing Bloomberg historical data into R.
I found them to be very useful.
Has anyone succeeded in getting the below items
from Bloomberg to R?
(a) historical economic release data,
(b) tick/intra-day data
(c) bulk data such as Index membership info, etc.
If someone is willing to share their code
2011 Aug 24
2
Split data frame by date (POSIXlt)
Hello everyone,
I want to split a data.frame by the column date . The data frame looks like
this
date time open close
02.01.2011 09:00:00 1000 1200
02.01.2011 09:05:02 1200 1203
...
01.02.2011 10:01:21 1029 1110
.....
30.03.2011 12:02:12 1231 1200
2009 Oct 02
1
xts dates spacings
Hello!
Please help - can't find any options how to remove very big spaces between
two dates containing intraday prices plotted by plot.xts. It looks like the
following: on the left side of the plot window is the first bunch of points,
the same is for the right hand side and a long line connecting them in the
middle. I would want to merge them (cut spaces) somehow.
In any case thanks for
2008 May 29
2
creating library
Hi,
I'm able to create a library with R CMD INSTALL cmd, etc... I'm just
wondering.. is it possible that when the user says library(boo), it runs
some initialization code?
I have a dumb R file that is:
print(2)
boo <- function(x){}
when I R CMD INSTALL the library, I'm able to see 2 in my unix console..
but when I do
library(boo)
in R afterwards.. I don't see
2010 Oct 25
4
zoo.read intraday data
Hello all,
I'm trying to use zoo.read but can't figure out
how to deal with the time format. (example below)
would be nice if someone could help.
best regards,
Immanuel
---------------------------
L <- "Date,Time,Open,High,Low,Close,Up,Down
05.02.2001,00:30,421.20,421.20,421.20,421.20,11,0
05.02.2001,01:30,421.20,421.40,421.20,421.40,7,0
2010 Jun 05
5
Matrix to Vector
Given a matrix of m*n, I want to reorder it as a vector, using a row major
transpose.
so:
> m<-matrix(seq(1,48),nrow=6,byrow=T)
> m
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 1 2 3 4 5 6 7 8
[2,] 9 10 11 12 13 14 15 16
[3,] 17 18 19 20 21 22 23 24
[4,] 25 26 27 28 29 30 31 32
[5,] 33 34 35 36 37