Displaying 20 results from an estimated 800 matches similar to: "Aggragating subsets of data in larger vector with sapply"
2011 Mar 04
4
xts POSIXct index format
Hi,
I cannot figure out how to change the index format when displaying POSIXct
objects.
Would like the xts index to display as %H:%M:%OS3 when doing viewing the xts
object.
Think I am missing the obvious.
Cheers,
Chris
--
View this message in context: http://r.789695.n4.nabble.com/xts-POSIXct-index-format-tp3336136p3336136.html
Sent from the R help mailing list archive at Nabble.com.
2011 Jan 03
2
Regex to remove last character
Hi,
Have been having trouble trying to figure out the right regex parameters to
remove the last "." in timestamp with the following format:
Convert 09:30:00.377.853 to 09:30:00.377853
Thanks,
Chris
--
View this message in context: http://r.789695.n4.nabble.com/Regex-to-remove-last-character-tp3172466p3172466.html
Sent from the R help mailing list archive at Nabble.com.
2010 Oct 11
2
Slow reading multiple tick data files into list of dataframes
Hi,
I am trying to find the best way to read 85 tick data files of format:
> head(nbbo)
1 bid CON 09:30:00.722 09:30:00.722 32.71 98
2 ask CON 09:30:00.782 09:30:00.810 33.14 300
3 ask CON 09:30:00.809 09:30:00.810 33.14 414
4 bid CON 09:30:00.783 09:30:00.810 33.06 200
Each file has between 100,000 to 300,300 rows.
Currently doing nbbo.list<-
2011 Mar 02
1
Create a zoo/xts Time Series with Millisecond jumps
Is there a easy way to create the time index for a zoo/xts object for every
100 milliseconds.
eg. time Index would be:
10:00:00:100
10:00:00:200
10:00:00:300
10:00:00:400
I am looking to build an empty zoo/xts object with time index from 10am to
3pm, index jumps by 100ms each row.
Thanks,
Chris
--
View this message in context:
2011 Mar 18
1
Replace split with regex for speed ?
Have timestamp in format HH:MM:SS.MMM.UUU and need to remove the last "." so
it is in format HH:MM:SS.MMMUUU.
What is the fastest way to do this, since it has to be repeated on millions
of rows. Should I use regex ?
Currently doing it with a string split, which is slow:
>head(ts)
[1] 09:30:00.000.245 09:30:00.000.256 09:30:00.000.633 09:30:00.001.309
09:30:00.003.635
2011 Jan 04
1
XTS : merge.xts seems to have problem with character vectors
Hi,
Please can you tell me what I am doing wrong. When trying to merge two xts
objects, one of which has multiple character vectors for columns...I am just
getting NAs.
> str(t)
POSIXct[1:1], format: "2011-01-04 11:45:37"
> y2 = xts(matrix(c(letters[1:10]),5), order.by=as.POSIXct(c(t + 1:5)))
> names(y2) = c(1,2)
> y2
1 2
2011-01-04 11:45:38
2015 Jan 05
1
Symbolic links not visible on osx 10.10
Hi Ralph,
On 05.01.15 15:00, Ralph B?hme wrote:
>> [Programs]
>> path = /server/shares/programs
>> valid users = some users
>> read only = No
>> force create mode = 0660
>> force directory mode = 0770
>> vfs objects = fruit # tried without fruit vfs, no change
>
> on first reading I thought this sound
2013 Mar 15
22
[PATCH 00/09] arm: tools: build for arm64 and enable cross-compiling for both arm32 and arm64
The following patches shave some rough edges off the tools build system
to allow cross compiling for at least arm32 and arm64 based on the
Debian/Ubuntu multiarch infrastructure. They also add the necessary
fixes to build for arm64 (which I have only tried cross, not native).
I have posted some instructions on how to compile with these patches on
the wiki:
2010 Oct 04
3
Loop too slow for Bid calc - BUT cannot figure out how to do with matrix
Hi,
I am trying to create Bid/Ask for each second from a high volume stock and
the only way I have been able to solve this is using loops to create the
target matrix from the source tick data matrix. Looping is too slow and
not practical to use on multiple stocks. For example:
Bids Matrix (a real one is 400,000++ length):
Bid Time
10.03 11:05:03.124
10.04 11:05:03.348
10.05
2004 Apr 20
1
AD<->Linux: Thoughts
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have a small planning problem...
I built an environment for a customer about six (or so) months
ago based on RH8 which authenticate and mount homes from an
AD server... The Linux stuff was straigt forward - using LibNSS/LDAP
and LibPAM/{LDAP,Krb5} for authentication and samba (2.x something)
to mount the home directories.
Unfortunatly, this
2011 Jun 20
1
Vi mode in Linux console - how to stop it ?
Hi,
When I am editing a command using default R console in Linux, sometimes it
is going into "vi mode"...not too sure how/why this happening. It then
requires me to use vi commands to edit the line, which is very frustrating
when I just want to use the delete key instead of "x" to delete a character.
How do I turn this off ?
Thanks,
Chris
--
View this message in context:
2010 Oct 08
2
Time OffSet From GMT - Losing it
Losing time offset from GMT:
> sTime = as.POSIXct(paste("2008-03-03","09:30:01"), origin="1970-01-01")
> sTime
[1] "2008-03-03 09:30:01 EST" <---- 9.31am EST
> sTime
[1] 1204554601
> t = as.numeric(sTime)
> as.POSIXct(t, origin="1970-01-01")
[1] "2008-03-03 14:30:01 EST" <----- no tz option and t is sTime + 5
2011 Mar 09
3
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Hi,
I am processing tick data and my code has stopped working as I have
increased the size of data being processed. Now I am receiving error for
basic tasks in RConsole:
> a = c(1:1000)
Error: evaluation nested too deeply: infinite recursion /
options(expressions=)?
My R code worked fine with 50 stocks and 500,000 rows per stock, but when I
increased this to 50 stocks and 5,000,000 rows per
2015 Jan 05
4
Symbolic links not visible on osx 10.10
Hello,
I'm using the latest git 4.2.0 samba version (4.2.0rc4-GIT-93b73bf, to
get latest vfs_fruit module). I noticed the following strange behavior
with OSX clients (10.10.1, 10.10.2 beta):
When they connect using either smb 3.0 or 2.1 (verified on the server
with `smbstatus` and the `version` column `SMB3_00` or `SMB2_10`
respectively), symbolic links pointing at non existent files are not
2015 Feb 16
2
Small typo in german translation
Dear developers,
I found a small typo in the german translation for the aggregate() function:
In the string "keine Zeile f?r die Aggragation" it should be spelled
'Aggregation' instead of 'Aggragation' (e instead a).
After a quick look into the sources, I found two places for it:
#grep -r -e "Aggragation" *
src/library/stats/po/R-de.po:msgstr "keine
2009 Jul 23
3
Calculate weighted mean for each group
Hi R experts,
I need know how calculate a weighted mean by group in a data frame. I have
tried with aggragate() function:
data.frame(x=c(15,12,3,10,10),g=c(1,1,1,2,2,3,3),w=c(2,3,1,5,5,2,5)) -> d
aggregate(d$x,by=list(d$g),weighted.mean,w=d$w)
Generating the following error:
Error en FUN(X[[1L]], ...) : 'x' and 'w' must have the same length
Thanks in advance
[[alternative
2007 Jan 07
0
Multiple plots via sapply or lapply?
Hi all,
I've got the following problem. I have a vector containing file names. I
want to read these files as csv and calculate the density-function for
each file (has just one column with data). Then, I'd like to plot all
density functions into one window. I did the following to calculate the
density data:
s <- sapply(filelist, function(x) {
if(file.exists(x))
{
file <-
2010 Jun 13
2
Scope and sapply
I am puzzled by the scope rules that apply with sapply.
If I want to modify a vector with sapply I tried...
N <- 10
vec <- vector(mode="numeric", length=N)
test <- function(i){
vec[i] <- i
}
sapply(1:N, test)
vec
but it not work.
How can this be done?
Worik
[[alternative HTML version deleted]]
2002 Dec 21
1
apply vs. sapply
Hi,
sapply((1:NCOL(hermes)),function(x) hist(hermes[,x],main=names(hermes)[x]))
.......this works , but i would like use it with apply to generate many plots in one step!
####################################################################
>>apply((1:ncol(hermes)),2,function(x) hist(hermes[,x],main=names(hermes)[x]))
Error in apply(1:ncol(hermes), 2, function(x) hist(hermes[, x], main =
2012 Aug 02
1
sapply and matrix command
HI,
You can also try this:
d<-1:25
A<-sample(combn(20:30,2))
B<-sample(combn(20:30,2))
lapply(d,function(x) matrix(c(1,A[x],B[x],1),2,2))
[[1]]
[,1] [,2]
[1,] 1 23
[2,] 27 1
[[2]]
[,1] [,2]
[1,] 1 21
[2,] 21 1
[[3]]
[,1] [,2]
[1,] 1 29
[2,] 23 1
[[4]]
[,1] [,2]
[1,] 1 25
[2,] 20 1
[[5]]
[,1] [,2]
[1,] 1 23
[2,]