Re: [R] ff package: reading selected columns from csv

2012-07-26 Thread threshold
Dear Jan, thank you for your answer. I am basically following the code Ive been using with read.table, where x.class - c('NULL', 'numeric','NULL','NULL','NULL', 'NULL', 'NULL') has been working fine. Reading all columns works with me but take much longer than allowed time constrains.. (460 such

Re: [R] ff package: reading selected columns from csv

2012-07-26 Thread threshold
*..plus I get the following message after reading the whole set (all 7 columns):* read.csv.ffdf(file=csvfile, header=FALSE, skip=100, first.rows=1000, next.rows=1e7, VERBOSE=TRUE) read.table.ffdf 1..1000 (1000) csv-read=0.02sec ffdf-write=0.08sec read.table.ffdf 1001..10001000 (1000)

[R] ff package: reading selected columns from csv

2012-07-25 Thread threshold
*Dear R users, Ive just started using the ff package. There is a csv file (~4Gb) with 7 columns and 6e+7 rows. I want to read only column from the file, skipping the first 100 rows. Below Ive provided different outcomes, which will clarify my problem * sessionInfo() R version 2.14.2 (2012-02-29)

[R] time my process

2012-03-29 Thread threshold
Dear R users, given a simple plotting procedure below, how can I make the figures changing on a slower rate (say every 2 sec) for(i in 1:100){ts.plot(rnorm(i))} Best, robert -- View this message in context: http://r.789695.n4.nabble.com/time-my-process-tp4514836p4514836.html Sent from the R

Re: [R] split date nad time

2011-12-12 Thread threshold
Thanks for help. Ive already sorted this out. robert -- View this message in context: http://r.789695.n4.nabble.com/split-date-nad-time-tp4164191p4185788.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] not complete character in csv file

2011-12-12 Thread threshold
Dear R users, I got the following problem. Given that data[3,2] [1] 010252 Code: intro - data.frame() intro[1,1] - as.character(data[3,2]) write.csv(intro, file='intro.csv') In 'intro.csv' file I am loosing the 0 in frot of 10252, which I need. Is there a way to keep the full character saved?

Re: [R] not complete character in csv file

2011-12-12 Thread threshold
Indeed in txt it looks fine. Anyway, I must stay without 0 because csv is THE format. I got another question. why for Table - matrix(0,8,3) day = Monday Table[1,1]=day all other elements become characters too? Thanks, robert -- View this message in context:

Re: [R] not complete character in csv file

2011-12-12 Thread threshold
right, Table - data.frame(matrix(0,8,3)) day = Monday Table[1,1]=day Table[1,2]=3 works, thanks a lot. robert -- View this message in context: http://r.789695.n4.nabble.com/not-complete-character-in-csv-file-tp4185785p4186639.html Sent from the R help mailing list archive at Nabble.com.

[R] split date nad time

2011-12-06 Thread threshold
Dear R Users, given that: AggDateTime[960:962] [1] 2011-08-25 23:59:00 BST 2011-08-26 00:00:00 BST [3] 2011-08-26 00:01:00 BST unlist(strsplit(as.character(AggDateTime[960]), , fixed=TRUE)) [1] 2011-08-25 23:59:00 unlist(strsplit(as.character(AggDateTime[962]), , fixed=TRUE)) [1]

Re: [R] split date nad time

2011-12-06 Thread threshold
ok, dput(AggDateTime[960:962]) structure(c(1314313140L, 1314313200L, 1314313260L), class = c(POSIXct, POSIXt), tzone = ) -- View this message in context: http://r.789695.n4.nabble.com/split-date-nad-time-tp4164191p4165378.html Sent from the R help mailing list archive at Nabble.com.

[R] hour in x-axis

2011-11-29 Thread threshold
Dear R useres, got the following problem. Given the AggData (listed below) I need to plot AggData[,2] vs time (AggData[,1]) for chosen 'rows'. Ive done already: plot(AggData[rows,2], xaxt='n') axis(1,at=seq(1,length(rows),1),sub(,, AggData[rows,1])) which works, but I need to list only chosen

[R] detect subset in series

2011-11-16 Thread threshold
Dear R Users, I am curious whether there is any simple solution o my problem. My example 'series': series - c(1,1,1,0,1,0,0,1,1,0,0,0,0,1) My 'subset' of interest: subset - c(0,0,0,0) Is there any function which tells me that the subset exists in my series, and gives me position where in series

Re: [R] detect subset in series

2011-11-16 Thread threshold
Thanks for the answer. I found that smth like below works subset - c(1,0,0) series - c(1,1,1,0,1,0,0,1,1,0,0,0,0,1) subset1 - paste(subset, collapse='') series1 - paste(series, collapse='') xx - gregexpr(subset1, series1, fixed=TRUE) as.numeric(xx[[1]]) ## yields the first element numbers in

[R] heatmap

2011-10-18 Thread threshold
Dear R users, need help with my heatmap. I will really approciate some help. Given the matrix: head(x) A B C D time [1,] 0 8 0 01 [2,] 0 160 0 02 [3,] 0 175 0 03 [4,] 0 253 0 04 [5,] 79 212 0 05 [6,] 6 105 0 06 and call: ## Heatmap

[R] date and time

2011-10-14 Thread threshold
Dear R users, I got date and time as two separate characters [1] 2008-04-11 [1] 22:00:00 which correspond to my starting point in time domain. Now I need to produce series over, 5 sec epochs up to end point, say: [1] 2008-04-12 [1] 23:00:00 So something like 2008-04-11 22:00:00 2008-04-11

[R] censoring symbols on survfit plot

2011-02-17 Thread threshold
Hi, when ploting Kaplan-Meier estimate curves as below, the censoring symbols (crosses) to not change thickness along the lines plot(survfit(surv ~ I(x=cut.off) ),lty=c(1,2), lwd=2) is there any strightforward way to make it happen? thanks robert -- View this message in context:

[R] postscript window size

2010-11-06 Thread threshold
Dear R users, simple figure: postscript(file=~/Desktop/figure.ps, horizontal=T, width=20, height=10) par(mfcol=c(2,5)) plot(rnorm(100), type='l') plot(rnorm(100), type='l') plot(rnorm(100), type='l') plot(rnorm(100), type='l') plot(rnorm(100), type='l') ##- plot(rnorm(100), type='l')

Re: [R] legend

2010-09-27 Thread threshold
Thanks David, works fine! robert -- View this message in context: http://r.789695.n4.nabble.com/legend-tp2550747p2715250.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] legend

2010-09-22 Thread threshold
Hi, there is a function to plot survival curves: library(survival) plot.KM - function(survival, x, x_cut.off, main='', label='') { plot(survfit(survival ~ I(x = x_cut.off)), main=main) legend('bottomleft', c(expression(label = x_cut.off),expression(label x_cut.off))) } Now, I need to determine

Re: [R] xlab with text and expression

2010-09-14 Thread threshold
One more question, given that plot(rnorm(1),rnorm(1), ylab=expression(a~b = 3), cex.lab=1.2) then sign = seems to be smaller than the rest, seems like cex.lab=1.2 affects only the text in ylab. 1) Is there any way to alter its size to follow the size of the whole expression? It works nice for

[R] shade area between 'ablines'

2010-09-13 Thread threshold
Hi, want to shade the area between dotted lines: x=c(1,5);y=c(1,5) plot(y~x, type='n') abline(v=c(2,3), lty=2) sometnig simple needed. tried with polygon thx, robert -- View this message in context: http://r.789695.n4.nabble.com/shade-area-between-ablines-tp2537352p2537352.html Sent

Re: [R] shade area between 'ablines'

2010-09-13 Thread threshold
Thanks for replying, indeed works. I forgot to mention that I am looking for a 'transparent shading' s.t. the plot symbols are still visible on the shaded area. robert -- View this message in context: http://r.789695.n4.nabble.com/shade-area-between-ablines-tp2537352p2537479.html Sent from the

[R] xlab with text and expression

2010-09-11 Thread threshold
Dear R users, say plot(rnorm(1)~rnorm(1), xlab=paste('abc', expression(x=1)), I want proper sign of weak inequality not just '=' will appreciate! robert -- View this message in context: http://r.789695.n4.nabble.com/xlab-with-text-and-expression-tp2535732p2535732.html Sent from the R help

Re: [R] xlab with text and expression

2010-09-11 Thread threshold
thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/xlab-with-text-and-expression-tp2535732p2535785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] legend with lines and points

2010-05-04 Thread threshold
Hi, say there are x and y given as: level x y 3 0.112 0.012 2 0.432 0.111 1 0.415 0.053 3 0.380.005 2 0.607 0.01 1 NA NA 3 0.572 0.01 2 0.697 0.039 1 0.377 0.006 3 NA NA 2 0.571 0.003 1

[R] retrieve from function

2010-02-19 Thread threshold
Hi, say I got the function: x=function(nbr){y-rnorm(nbr);y1 - mean(y);plot(y)} how can I retrieve value of y1, when I need it. I don't want: x=function(nbr){y-rnorm(nbr);y1 - mean(y);plot(y)} y1 I want someting like: x$y1 and then I get the value Many thanks, robert -- View this

Re: [R] retrieve from function

2010-02-19 Thread threshold
Thank you for response. The problem is that using return(y1) in my function formula always returns y1, but what I want is to return it only when I wish, like p.value in t.test(rnorm(100),rnorm(100))$p.value robert -- View this message in context:

[R] 3dscatter for linux

2009-05-13 Thread threshold
Hi, do you have any suggestions how to make 3D scatterplot, BUT under linux. Worth mentioning is the fact that 'scatterplot3d' does not load under Ubuntu 8.10. Do you know any alternatives?? I tried cloud or persp but X,Y and Z axes are emprical in my case, and cannot be replaced by any seq(...).

[R] function return output

2009-01-16 Thread threshold
Hi, I wrote the function which outputs a matrix 'c' and a single value 'd', as follows (simplified example): procedure - function(a,b){ ... list(c,d) } now I want to use 'c' and 'd' in code as follows: d - matrix(0,1,1) value - procedure(a,b) and d[1,1] - value[2] breaks telling that: Error in

[R] re ad.table

2008-12-19 Thread threshold
Hi , I want to use the read.table to the following example 'data.txt' format: a b c d e f SPX LSZ 100 C 0 34.4 SPX LSZ 100 P 0 1.3 SPX LSZ 105 C 0 30.3 SPX LSZ 105 P 0 1.85

[R] match

2008-12-02 Thread threshold
Hi, I would like to check which rows of 'types.prev' matrix pop up in 'types', following R in-built procedure. I tried 'match' function but it works in case of the one dimensional vectors. Will appreciate any suggestions. best, robert types edateK [1,] 20060819 12.5 [2,]

[R] ts.plot

2008-07-06 Thread threshold
Hi, my question concerns the following (guess) easy case. I have daily data over 5-year period say 199017.24 199018.19 199019.22 . . 199120.11 199120.26 199122.2 . . 199420.05 199424.64 199426.34 and I want to make ts.plot of the 2nd column with respect to year

Re: [R] optimization setup

2008-05-30 Thread threshold
and actual parameters. When you invoke f3 (within optim()), theta is not defined within f3(). Ray On Fri, 30 May 2008, threshold wrote: Hi, thanks for your replay the previous post of mine. Let me ask you one more question similar to the previous one, based on a naive example: f1-function

[R] Ubuntu rJava

2008-05-29 Thread threshold
Hi I am using ubuntu 8.04 and faced some problems when installing rJava. What I did first was install.packages(rJava) but I could not proceed since: checking Java support in R... configure: error: absent R was configured without Java support. Please run R CMD javareconf as root to add Java

Re: [R] optimization setup

2008-05-29 Thread threshold
: On Wed, 23 Apr 2008, threshold wrote: Hi, here comes my problem, say I have the following functions (example case) # function1 - function (x, theta) {a - theta[1] ( 1 - exp(-theta[2]) ) * theta[3] ) b - x * theta[1] / theta[3]^2

[R] number of trading days

2008-05-21 Thread threshold
Hi, I work on the date format: mmdd. I would like to calculate the number of (working or trading) days between two of such specified dates in specific year at US stock exchange OR at least with respect to 252-days year. What I did so far was the conversion (example): x-20060213; y-20060402 #

[R] optimization setup

2008-04-22 Thread threshold
Hi, here comes my problem, say I have the following functions (example case) # function1 - function (x, theta) {a - theta[1] ( 1 - exp(-theta[2]) ) * theta[3] ) b - x * theta[1] / theta[3]^2 return( list( a = a, b = b )) }

[R] Change the core code

2008-04-21 Thread threshold
HI, pretty basic question: is that possible to change the code of the function within library? If so what should I do? I work on R linux (ubuntu), thanks a lot -- View this message in context: http://www.nabble.com/Change-the-core-code-tp16808285p16808285.html Sent from the R help mailing

[R] R-Latex question

2008-03-11 Thread threshold
Hi, maybe my question is not typical. I want to make R table-kind output to be readable immediately in Latex but I am struggling with symbol '\' needed for instance in '\hline'. For example when 'Table' is a matrix class object: cat(,Table[1,1], ,Table[1,2], \n);flush.console() cat(\hline

[R] standard errors

2008-02-28 Thread threshold
Hi, guess my problem has simple solution. I want to extract ONLY Std. Errors of Max. Lik. estimates (my_fit-mle(object,...)), the same as I can do with estimates by: x-as. matrix(coef(my_fit)). I could not find any function similar to 'coef(my_fit)', which extracts only Standard Errors. So far

[R] surface plot

2008-01-24 Thread threshold
Hi, there is following issue, which I encounter when doing data analysis. Say we have data in form of the matrix x: x [,1] [,2] [,3] [1,] 0.14 10 [2,] 0.25 11 [3,] 0.15 12 [4,] 0.16 13 [5,] 0.24 14 [6,] 0.35 16 now I want to do surface plot of

[R] sorting

2008-01-20 Thread threshold
Hi, I want to sort my matrix according to (any) selected column. For example given matrix: x [,1] [,2] [,3] [1,]347 [2,]258 [3,]169 I want to sort the first column in ascending order and make the other columns follow the 'new order' like: x1 [,1]

[R] matrix graph

2007-12-11 Thread threshold
Hi All, simple question: do you know how to graph the following object/matrix in a 'surface manner': [,1] [,2] [,3][,4] [,5][,6] [1,] -0.154 -0.065 0.129 0.637 0.780 0.221 [2,] 0.236 0.580 0.448 0.729 0.859 0.475 [3,] 0.401 0.506 0.310 0.650 0.822 0.448 [4,]

[R] 3D array

2007-12-03 Thread threshold
Hi, I deal with 3D array say: , , 1 [,1] [,2] [,3] [,4] [,5] [1,]147 10 13 [2,]258 11 14 [3,]369 12 15 , , 2 [,1] [,2] [,3] [,4] [,5] [1,] 16 19 22 25 28 [2,] 17 20 23 26 29 [3,] 18 21 24 27 30 , , 3

[R] cumsum

2007-11-03 Thread threshold
Hi, my problem belongs to the basic ones. I want to get cumulated sum over the matrix columns by one command (if such exists). Ordinary R's cumsum(x) when x is: [,1] [,2] [1,]15 [2,]26 [3,]37 [4,]48 yields: 1 3 6 10 15 21 28 36 I want: [,1] [,2] [1,]

[R] jEdit for R

2007-10-24 Thread threshold
Hi, I just installed jEdit but have no clue, whether I can run my code a'la ctrl-R directly from jEdit script, or should source it from R command line, after saving it first in jEdit. thanks for any help, rob -- View this message in context: