Re: [R] Unable to Scale/Display properly in plotting a xts/timeseries graph in a single plot

2015-04-07 Thread Raghuraman Ramachandran
sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United
Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] RCurl_1.95-4.5 bitops_1.0-6   XML_3.98-1.1   xts_0.9-7  zoo_1.7-11

loaded via a namespace (and not attached):
[1] grid_3.0.2  lattice_0.20-29 tools_3.0.2 TTR_0.22-0

Thanks
Raghu

On Tue, Apr 7, 2015 at 5:47 PM, Joshua Ulrich  wrote:
> On Tue, Apr 7, 2015 at 11:30 AM, Raghuraman Ramachandran
>  wrote:
>> Dear guRus
>>
>> I have xts data as:
>> str(volsA)
>> An ‘xts’ object on 2014-05-13/2015-04-07 containing:
>>   Data: num [1:221, 1:2] 18.8 18.5 18.4 22.2 22 ...
>>  - attr(*, "dimnames")=List of 2
>>   ..$ : NULL
>>   ..$ : chr [1:2] "vol1" "vol2"
>>   Indexed by objects of class: [Date] TZ: UTC
>>   xts Attributes:
>> List of 1
>>  $ na.action:Class 'omit'  atomic [1:20] 1 2 3 4 5 6 7 8 9 10 ...
>>   .. ..- attr(*, "index")= num [1:20] 1.4e+09 1.4e+09 1.4e+09 1.4e+09
>> 1.4e+09 ...
>>>
>> I am trying t0 plot them in a single frame but the scaling does not
>> happen properly.
>>
>> plot(vols,plot.type="s",format="auto")
>> lines(vols[,2],col="red")
>>
>> The lower graph in red gets displayed as a truncated graph and does
>> not fully exhibit the relationship. Can someone kindly help in
>> scaling/display please?
>>
> What's the output of sessionInfo() from your R session?
>
>> Thanks
>> Raghu
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
>
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Unable to Scale/Display properly in plotting a xts/timeseries graph in a single plot

2015-04-07 Thread Raghuraman Ramachandran
Thanks Josh. I am not sure if I can attach a Jpeg. Please find attached.

On Tue, Apr 7, 2015 at 5:47 PM, Joshua Ulrich  wrote:
> On Tue, Apr 7, 2015 at 11:30 AM, Raghuraman Ramachandran
>  wrote:
>> Dear guRus
>>
>> I have xts data as:
>> str(volsA)
>> An ‘xts’ object on 2014-05-13/2015-04-07 containing:
>>   Data: num [1:221, 1:2] 18.8 18.5 18.4 22.2 22 ...
>>  - attr(*, "dimnames")=List of 2
>>   ..$ : NULL
>>   ..$ : chr [1:2] "vol1" "vol2"
>>   Indexed by objects of class: [Date] TZ: UTC
>>   xts Attributes:
>> List of 1
>>  $ na.action:Class 'omit'  atomic [1:20] 1 2 3 4 5 6 7 8 9 10 ...
>>   .. ..- attr(*, "index")= num [1:20] 1.4e+09 1.4e+09 1.4e+09 1.4e+09
>> 1.4e+09 ...
>>>
>> I am trying t0 plot them in a single frame but the scaling does not
>> happen properly.
>>
>> plot(vols,plot.type="s",format="auto")
>> lines(vols[,2],col="red")
>>
>> The lower graph in red gets displayed as a truncated graph and does
>> not fully exhibit the relationship. Can someone kindly help in
>> scaling/display please?
>>
> What's the output of sessionInfo() from your R session?
>
>> Thanks
>> Raghu
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
>
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Unable to Scale/Display properly in plotting a xts/timeseries graph in a single plot

2015-04-07 Thread Raghuraman Ramachandran
Dear guRus

I have xts data as:
str(volsA)
An ‘xts’ object on 2014-05-13/2015-04-07 containing:
  Data: num [1:221, 1:2] 18.8 18.5 18.4 22.2 22 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:2] "vol1" "vol2"
  Indexed by objects of class: [Date] TZ: UTC
  xts Attributes:
List of 1
 $ na.action:Class 'omit'  atomic [1:20] 1 2 3 4 5 6 7 8 9 10 ...
  .. ..- attr(*, "index")= num [1:20] 1.4e+09 1.4e+09 1.4e+09 1.4e+09
1.4e+09 ...
>
I am trying t0 plot them in a single frame but the scaling does not
happen properly.

plot(vols,plot.type="s",format="auto")
lines(vols[,2],col="red")

The lower graph in red gets displayed as a truncated graph and does
not fully exhibit the relationship. Can someone kindly help in
scaling/display please?

Thanks
Raghu

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Reading in an XLS (really XML) file from website

2015-02-27 Thread Raghuraman Ramachandran
This works:
Change the destination directory to suit you.

MyURL1 = "http://www.ishares.com/us/239726/fund-download.dl";
download.file(MyURL1,paste("C:/Data/Rtest1",date1,"r.xls",sep=""),method="wget",quiet=TRUE,mode="wb",
 extra="--header=\"User-Agent: Mozilla/5.0
(X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0\"")

Cheers
Raghu


On Fri, Feb 27, 2015 at 4:01 PM, Bos, Roger  wrote:
> All,
>
> I am trying to read the S&P 500 constituents from the iShares website using 
> the following code:
>
>URL <- "http://www.ishares.com/us/239726/fund-download.dl";
>setInternet2(TRUE)
>download.file(url=URL, destfile="temp.xls")
>out <- readWorksheetFromFile(file="temp.xls", sheet="Holdings", 
> header=TRUE, startRow=13)
>
> R returns the following error:
>
>>out <- readWorksheetFromFile(file="temp.xls", sheet="Holdings", 
>> header=TRUE, startRow=13)
> Error: IllegalArgumentException (Java): Your InputStream was neither an OLE2 
> stream, nor an OOXML stream
> In addition: Warning message:
> In download.file(url = URL, destfile = "temp.xls") :
>   downloaded length 1938303 != reported length 200
>
> Upon further examination this is because the format is really XML.  Is there 
> any way to get XLConnect or any other excel reader to read in an XML file?  I 
> thought XML was for new Excel format.
>
> Barring that, can we read in the file using the XML package? I tried the 
> following code...
>
>require(XML)
>tmp <- xmlParse(URL)
>
> ... but I get this error:
>
> Opening and ending tag mismatch: Style line 14 and Style
> Error: 1: Opening and ending tag mismatch: Style line 14 and Style
>
> Thanks in advance for any help or hints,
>
> Roger
>
>
>
> ***
> This message and any attachments are for the named person's use only.
> This message may contain confidential, proprietary or legally privileged
> information. No right to confidential or privileged treatment
> of this message is waived or lost by an error in transmission.
> If you have received this message in error, please immediately
> notify the sender by e-mail, delete the message, any attachments and all
> copies from your system and destroy any hard copies. You must
> not, directly or indirectly, use, disclose, distribute,
> print or copy any part of this message or any attachments if you are not
> the intended recipient.
>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] plotting multiple time series under one panel

2015-02-25 Thread Raghuraman Ramachandran
Dear guRus

I have data frame as:
str(voldf)
'data.frame': 130 obs. of  8 variables:
 $ Date: Date, format: "2014-08-01" "2014-08-05" "2014-08-08" ...
 $ kc  : num  0.453 0.424 0.468 0.481 0.485 ...
 $ sb  : num  0.1128 0.123 0.1272 0.1128 0.0949 ...
 $ qc  : num  0.0626 0.0661 0.0777 0.0765 0.0763 ...
 $ c   : num  0.167 0.182 0.183 0.21 0.215 ...
 $ w   : num  0.21 0.271 0.282 0.351 0.345 ...
 $ s   : num  0.249 0.253 0.295 0.332 0.35 ...
 $ ct  : num  0.212 0.22 0.228 0.188 0.181 ...

I am trying to plot multiple line charts for each of the columns and
show them together in the same panel. Is it possible please using
ggplot?

I tried melting dfm=melt(voldf, id.vars="Date") and then plotted this
but it gives me all graphs in one panel which did not help.

Any assistance is greatly appreciated.

Many thx
Raghu

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with Time

2014-11-22 Thread Raghuraman Ramachandran
Hi Boris/ David

Many thanks for the kind assistance. I will try following your codes.
Time has always been a slippery subject to me!

Cheers


On Sat, Nov 22, 2014 at 12:59 AM, David Winsemius
 wrote:
>
> On Nov 21, 2014, at 3:19 PM, David Winsemius wrote:
>
>>
>> On Nov 21, 2014, at 2:55 PM, Raghuraman Ramachandran wrote:
>>
>>> Sorry I forgot to mention it clearly. I like to round it to the
>>> nearest 30th minute that is past. So 12:28:59 will be again 12:00:00
>>> and
>>> 12:59:59 will be 12:30:00 etc. Apologies for the lack of clarity in
>>> the beginning.
>>>
>>
>> That's just truncation. Should be very easy to hack trunc.POSIXt to deliver 
>> that result. Add a "half_hr" unit to the list and then a simple extra clause 
>> that check for minutes >30.
>
> In my first effort I used an if(){}else{} construction, committing the newbie 
> mistake of forgetting it was not the vectoRized way. So this performs better:
>
> trunc.POSIXt <-
> function (x, units = c("secs", "mins", "half_hrs", "hours", "days"), ...)
> {
> units <- match.arg(units)
> x <- as.POSIXlt(x)
> if (length(x$sec))
> switch(units, secs = {
> x$sec <- trunc(x$sec)
> }, mins = {
> x$sec[] <- 0
> }, half_hrs = {
> x$sec[] <- 0
> x$min[] <- 0L+ 30L*(x$min >=30)
> }, hours = {
> x$sec[] <- 0
> x$min[] <- 0L
> }, days = {
> x$sec[] <- 0
> x$min[] <- 0L
> x$hour[] <- 0L
> x$isdst[] <- -1L
> })
> x
> }
>
>> time <- seq(Sys.time(), Sys.time()+60*120, by= 60*5)
>> trunc(time, "half_hrs")
>  [1] "2014-11-21 15:30:00 PST" "2014-11-21 15:30:00 PST"
>  [3] "2014-11-21 15:30:00 PST" "2014-11-21 15:30:00 PST"
>  [5] "2014-11-21 15:30:00 PST" "2014-11-21 15:30:00 PST"
>  [7] "2014-11-21 16:00:00 PST" "2014-11-21 16:00:00 PST"
>  [9] "2014-11-21 16:00:00 PST" "2014-11-21 16:00:00 PST"
> [11] "2014-11-21 16:00:00 PST" "2014-11-21 16:00:00 PST"
> [13] "2014-11-21 16:30:00 PST" "2014-11-21 16:30:00 PST"
> [15] "2014-11-21 16:30:00 PST" "2014-11-21 16:30:00 PST"
> [17] "2014-11-21 16:30:00 PST" "2014-11-21 16:30:00 PST"
> [19] "2014-11-21 17:00:00 PST" "2014-11-21 17:00:00 PST"
> [21] "2014-11-21 17:00:00 PST" "2014-11-21 17:00:00 PST"
> [23] "2014-11-21 17:00:00 PST" "2014-11-21 17:00:00 PST"
> [25] "2014-11-21 17:30:00 PST"
>
>
>> --
>> David.
>>
>>
>>> Many thanks
>>> Raghu
>>>
>>> On Fri, Nov 21, 2014 at 10:52 PM, Raghuraman Ramachandran
>>>  wrote:
>>>> Dear guRus
>>>>
>>>> How can I round of time in R to the nearest 30th minute please?
>>>>
>>>> For example suppose if
>>>>> Sys.time()
>>>> [1] "2014-11-21 22:49:05.59042 GMT"
>>>> then I would like a function that outputs 22:30:00.
>>>>
>>>> if Sys.time is 12:13:22 then I would like to get 12:00:00 etc.
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Many thanks and regards,
>>>> Raghu
>>>
>>> __
>
>>
>
> David Winsemius
> Alameda, CA, USA
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with Time

2014-11-21 Thread Raghuraman Ramachandran
Sorry I forgot to mention it clearly. I like to round it to the
nearest 30th minute that is past. So 12:28:59 will be again 12:00:00
and
12:59:59 will be 12:30:00 etc. Apologies for the lack of clarity in
the beginning.

Many thanks
Raghu

On Fri, Nov 21, 2014 at 10:52 PM, Raghuraman Ramachandran
 wrote:
> Dear guRus
>
> How can I round of time in R to the nearest 30th minute please?
>
> For example suppose if
>>Sys.time()
> [1] "2014-11-21 22:49:05.59042 GMT"
> then I would like a function that outputs 22:30:00.
>
> if Sys.time is 12:13:22 then I would like to get 12:00:00 etc.
>
> Any help would be appreciated.
>
> Many thanks and regards,
> Raghu

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help with Time

2014-11-21 Thread Raghuraman Ramachandran
Dear guRus

How can I round of time in R to the nearest 30th minute please?

For example suppose if
>Sys.time()
[1] "2014-11-21 22:49:05.59042 GMT"
then I would like a function that outputs 22:30:00.

if Sys.time is 12:13:22 then I would like to get 12:00:00 etc.

Any help would be appreciated.

Many thanks and regards,
Raghu

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with Download of a comma separated file in zip format

2014-07-17 Thread Raghuraman Ramachandran
Many thanks. I will try that.


On Thu, Jul 17, 2014 at 1:29 PM, Fábio Magalhães 
wrote:

> Hi Balaji,
>
> Sorry, I forgot to tell that I'm running R on OSX. I don't know if
> there's an easier way, but since you are running on Windows you could
> try to install curl(http://curl.haxx.se/) binaries and try the curl
> method again.
> #! Fábio
>
>
> On Thu, Jul 17, 2014 at 5:26 AM, Raghuraman Ramachandran
>  wrote:
> > Hi Fabio
> >
> > Can you please reproduce your output? When I tried it curl are the
> following
> > issues I get:
> >
> >>download.file("
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> ",
> >> temp, method="curl")
> > Error in
> > download.file("
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> ",
> > :
> >   object 'temp' not found
> >
> > Then I changed the destination file and checked again:
> > download.file("
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> ",
> > "c:/", method="curl")
> > Warning message:
> > In
> > download.file("
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> ",
> > :
> >   download had nonzero exit status
> >
> > I was still unable to get that.
> >
> > Thx
> > Balaji
> >
> >
> >
> > On Wed, Jul 16, 2014 at 5:29 PM, Fábio Magalhães 
> > wrote:
> >>
> >> I was able to download it specifying the method as "curl", like this:
> >>
> >> >
> >> > download.file("
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> ",
> >> > temp, method="curl")
> >> #! Fábio
> >>
> >>
> >> On Tue, Jul 15, 2014 at 3:46 PM, Electron Musketeer
> >>  wrote:
> >> > Many thanks Ista. I will try other routes as well.
> >> > Thanks Jeff and sorry for posting without abiding by the rules.
> >> > Thanks James. I would rather automate this than download manually
> >> > everytime. That is my intent.
> >> >
> >> > Best
> >> > Balaji
> >> >
> >> >
> >> > On Tue, Jul 15, 2014 at 7:16 PM, Ista Zahn 
> wrote:
> >> >
> >> >> Not an R question, but see
> >> >> https://addons.mozilla.org/en-US/firefox/addon/cliget/ for an easy
> way
> >> >> to see what what is going on under the hood when you download using
> >> >> firefox. For your example I get
> >> >>
> >> >> wget --header='Host: www.nseindia.com' --header='User-Agent:
> >> >> Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0'
> >> >> --header='Accept:
> >> >> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
> >> >> --header='Accept-Language: en-US,en;q=0.5' --header='Connection:
> >> >> keep-alive' '
> >> >>
> >> >>
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> >> >> '
> >> >> -O 'fo09JUL2014bhav.csv.zip' -c
> >> >>
> >> >> Now you just need to translate that to R. (Or not, sometimes its
> >> >> easier to just shell out (using e.g., 'system()' ) and download with
> >> >> wget or curl).
> >> >>
> >> >> Best,
> >> >> Ista
> >> >>
> >> >> On Tue, Jul 15, 2014 at 11:24 AM, Electron Musketeer
> >> >>  wrote:
> >> >> > Dear Experts
> >> >> >
> >> >> > I am new to this forum and to R and was trying the following to
> >> >> > access a
> >> >> > zip file from  the webpages of the NSE. Here is my code.
> >> >> >
> >> >> > temp <- tempfile()
> >> >> > download.file("
> >> >> >
> >> >>
> >> >>
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> >> >> > ",temp)
> >> >> > con <- unz(temp, "a1.dat")
> >> >> > data <- matrix(scan(con),ncol=4,byrow=TRUE)
> >> &g

Re: [R] Help with Download of a comma separated file in zip format

2014-07-17 Thread Raghuraman Ramachandran
Hi Fabio

Can you please reproduce your output? When I tried it curl are the
following issues I get:

>download.file("
http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip";,
temp, method="curl")
Error in download.file("
http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip";,
 :
  object 'temp' not found

Then I changed the destination file and checked again:
download.file("
http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip";,
"c:/", method="curl")
Warning message:
In download.file("
http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip";,
 :
  download had nonzero exit status

I was still unable to get that.

Thx
Balaji



On Wed, Jul 16, 2014 at 5:29 PM, Fábio Magalhães 
wrote:

> I was able to download it specifying the method as "curl", like this:
>
> > download.file("
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip";,
> temp, method="curl")
> #! Fábio
>
>
> On Tue, Jul 15, 2014 at 3:46 PM, Electron Musketeer
>  wrote:
> > Many thanks Ista. I will try other routes as well.
> > Thanks Jeff and sorry for posting without abiding by the rules.
> > Thanks James. I would rather automate this than download manually
> > everytime. That is my intent.
> >
> > Best
> > Balaji
> >
> >
> > On Tue, Jul 15, 2014 at 7:16 PM, Ista Zahn  wrote:
> >
> >> Not an R question, but see
> >> https://addons.mozilla.org/en-US/firefox/addon/cliget/ for an easy way
> >> to see what what is going on under the hood when you download using
> >> firefox. For your example I get
> >>
> >> wget --header='Host: www.nseindia.com' --header='User-Agent:
> >> Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0'
> >> --header='Accept:
> >> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
> >> --header='Accept-Language: en-US,en;q=0.5' --header='Connection:
> >> keep-alive' '
> >>
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> >> '
> >> -O 'fo09JUL2014bhav.csv.zip' -c
> >>
> >> Now you just need to translate that to R. (Or not, sometimes its
> >> easier to just shell out (using e.g., 'system()' ) and download with
> >> wget or curl).
> >>
> >> Best,
> >> Ista
> >>
> >> On Tue, Jul 15, 2014 at 11:24 AM, Electron Musketeer
> >>  wrote:
> >> > Dear Experts
> >> >
> >> > I am new to this forum and to R and was trying the following to
> access a
> >> > zip file from  the webpages of the NSE. Here is my code.
> >> >
> >> > temp <- tempfile()
> >> > download.file("
> >> >
> >>
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> >> > ",temp)
> >> > con <- unz(temp, "a1.dat")
> >> > data <- matrix(scan(con),ncol=4,byrow=TRUE)
> >> > unlink(temp)
> >> >
> >> >
> >> > The result is:
> >> > cannot open URL '
> >> >
> >>
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> >> > '
> >> > In addition: Warning message:
> >> > In download.file("
> >> >
> >>
> http://www.nseindia.com/content/historical/DERIVATIVES/2014/JUL/fo09JUL2014bhav.csv.zip
> >> ",
> >> >  :
> >> >   cannot open: HTTP status was '403 Forbidden'
> >> >
> >> >
> >> > I tried accessing this file directly from the website and it is
> letting
> >> me
> >> > access it. My question is why is it not letting me download from R? I
> >> have
> >> > gone through some websites to see if this has been resolved but the
> older
> >> > resolutions also do not work. Can someone help please?
> >> >
> >> > Thx
> >> > Balaji
> >> >
> >> > [[alternative HTML version deleted]]
> >> >
> >> > __
> >> > R-help@r-project.org mailing list
> >> > https://stat.ethz.ch/mailman/listinfo/r-help
> >> > PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html
> >> > and provide commented, minimal, self-contained, reproducible code.
> >>
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] canonical correlation

2014-07-13 Thread Raghuraman Ramachandran
Thx John.

My bad. I was just pointing out that canonical corrs can be done through
the CCA package.

Cheers
Raghu


On Sun, Jul 13, 2014 at 3:39 PM, Monaly Mistry 
wrote:

> Dear John,
>
> In my final model I have 10 independent variables that account for the
> variation in my dependent variable, and I needed to visually demonstrate
> this relationship.  So I did a canonical correlation to get a linear
> combination of independent variables that that predicts the variation in my
> dependent variable to plot the relationship. Although I ended up using 2
> dependent variables in the canonical correlation analysis.
>
> Best,
>
> Monaly.
>
>
> On Sun, Jul 13, 2014 at 3:16 PM, John Fox  wrote:
>
>> A small correction: I should have said "R", not "R^2".
>>
>> John
>>
>> On Sun, 13 Jul 2014 10:14:23 -0400
>>  "John Fox"  wrote:
>> > Dear Raghuraman and Monaly,
>> >
>> > Why would one want to do canonical correlation with a single Y
>> variable? The canonical correlation is just the R^2 from the LS regression
>> of Y on the Xs.
>> >
>> > Best,
>> >  John
>> >
>> > --------
>> > John Fox, Professor
>> > McMaster University
>> > Hamilton, Ontario, Canada
>> > http://socserv.mcmaster.ca/jfox/
>> >
>> >
>> > On Sun, 13 Jul 2014 09:00:52 +0100
>> >  Raghuraman Ramachandran  wrote:
>> > > Try package CCA.
>> > >
>> > >
>> > > On Sat, Jul 12, 2014 at 11:13 PM, Monaly Mistry <
>> monaly.mis...@gmail.com>
>> > > wrote:
>> > >
>> > > > Hi,
>> > > >
>> > > > I was wondering if it's possible in R to do a canonical correlation
>> with
>> > > > only one dependent variable and several independent variables.
>> > > >
>> > > > I've tried using cc(X,Y) but I got an error message. In this case I
>> had 1
>> > > > dependent variable and 10 independent variables.
>> > > >
>> > > > Error in cor(X, use = "pairwise") :
>> > > >   supply both 'x' and 'y' or a matrix-like 'x'
>> > > >
>> > > > When I use two dependent variables I don't get the error message.
>> > > >
>> > > > Best,
>> > > >
>> > > > Monaly.
>> > > >
>> > > > [[alternative HTML version deleted]]
>> > > >
>> > > > __
>> > > > R-help@r-project.org mailing list
>> > > > https://stat.ethz.ch/mailman/listinfo/r-help
>> > > > PLEASE do read the posting guide
>> > > > http://www.R-project.org/posting-guide.html
>> > > > and provide commented, minimal, self-contained, reproducible code.
>> > > >
>> > >
>> > > [[alternative HTML version deleted]]
>> > >
>> > > __
>> > > R-help@r-project.org mailing list
>> > > https://stat.ethz.ch/mailman/listinfo/r-help
>> > > PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> > > and provide commented, minimal, self-contained, reproducible code.
>> >
>> > __
>> > R-help@r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>> 
>> John Fox, Professor
>> McMaster University
>> Hamilton, Ontario, Canada
>> http://socserv.mcmaster.ca/jfox/
>>
>>
>>
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] canonical correlation

2014-07-13 Thread Raghuraman Ramachandran
Try package CCA.


On Sat, Jul 12, 2014 at 11:13 PM, Monaly Mistry 
wrote:

> Hi,
>
> I was wondering if it's possible in R to do a canonical correlation with
> only one dependent variable and several independent variables.
>
> I've tried using cc(X,Y) but I got an error message. In this case I had 1
> dependent variable and 10 independent variables.
>
> Error in cor(X, use = "pairwise") :
>   supply both 'x' and 'y' or a matrix-like 'x'
>
> When I use two dependent variables I don't get the error message.
>
> Best,
>
> Monaly.
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Fwd: lm and 450k data

2014-07-12 Thread Raghuraman Ramachandran
Try this:
 mod = lm(methcol ~ exposure+X1+X2+X3+batch, data = meth_matrix)
res=coef(summary(mod))[2,]

It will good if you give a subset of data you are working on by dput.

Raghu


On Sat, Jul 12, 2014 at 3:11 PM, Jessica Timms 
wrote:

> Hi,
>
>
>
> I'm quite new to R and currently trying to use lm to fit linear models but
> I am currently stuck my code is as follows:
>
>
>
> Model1 = function(meth_matrix,exposure, X1, X2, X3, batch) {
>
>   mod = lm(meth_matrix[, methcol]~exposure+X1+X2+X3+batch)
>
>   res = summary(mod)$coef[2,]
>
>
>
> system.time(indiv.results <-  mclapply(setNames(ncol=473864(cord_betas)),
> dimnames(cord_betas)[[2]]), Model1, meth_matrix=cord_betas,
> exposure=filtered_pheno, X1=covariates$k032, X2=covariates$k021,
> X3=covariates$kz029, batch=pdata.B1221.cord$BCDPlate))
>
>
> }
>
>
>
> I am not sure if this will make any sense or if you need any more
> information?
>
> Any help or guidance would be massively appreciated.
>
>
>
> Best wishes
>
>
>
> Jessica Timms
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Execute Excel-Macro using R

2013-12-21 Thread Raghuraman Ramachandran
Try 'shell'? There must be a workaround to do this.


On Fri, Dec 20, 2013 at 9:58 AM, R_Antony  wrote:

> Hi,
>
> How to execute ms-Excel Macro(*.xlsm) using R function ? I tried but not
> get. There are method to call from R function from Excel macro, but i need
> Excel macro to execute from R. Is it possible ? I am using Excel-2010
> macro.
>
> Thanks in advance,
> Antony.
>
>
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Execute-Excel-Macro-using-R-tp4682533.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Contract Work

2013-10-15 Thread Raghuraman Ramachandran
Dear R-users

I am looking for a very experienced R developer for a derivatives project
in Bangalore. The developer should preferably be well versed in GUI etc.
The contract is for 4 to 6 months.

Please contact me in this email.

Thanks
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] MS Access

2013-06-14 Thread Raghuraman Ramachandran
Dear guRus

Can I use R inside Microsoft access Macros and programmes? I understand
that R-Excel is compatible but wish to know if I can use R inside Access
programmes please?

Many thanks
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Collapsing a vector/data-frame based on the previous values

2012-07-24 Thread Raghuraman Ramachandran
Many thanks Jim.

On Tue, Jul 24, 2012 at 2:25 PM, jim holtman  wrote:

> Here is another way of doing it:
>
> > states <- structure(list(Date = c("24/07/2012", "25/07/2012",
> "26/07/2012",
> + "27/07/2012", "28/07/2012", "24/07/2012", "25/07/2012", "26/07/2012",
> + "27/07/2012", "28/07/2012"), State = c(1L, 1L, 1L, 1L, 1L, -1L,
> + -1L, -1L, 1L, -1L)), .Names = c("Date", "State"), class = "data.frame",
> + row.names = c(NA,
> + -10L))
> > # mark the state changes
> > states$diff <- c(TRUE, diff(states$State) != 0)
> > states[states$diff,]
>  Date State diff
> 1  24/07/2012 1 TRUE
> 6  24/07/2012-1 TRUE
> 9  27/07/2012 1 TRUE
> 10 28/07/2012-1 TRUE
>
>
> On Tue, Jul 24, 2012 at 2:40 AM, Raghuraman Ramachandran
>  wrote:
> > Hello
> >
> > I have a data frame like this:
> > dput(states)
> > structure(list(Date = c("24/07/2012", "25/07/2012", "26/07/2012",
> > "27/07/2012", "28/07/2012", "24/07/2012", "25/07/2012", "26/07/2012",
> > "27/07/2012", "28/07/2012"), State = c(1L, 1L, 1L, 1L, 1L, -1L,
> > -1L, -1L, 1L, -1L)), .Names = c("Date", "State"), class = "data.frame",
> > row.names = c(NA,
> > -10L))
> >
> >> State
> >
> >   Date State
> > 1  24/07/2012 1
> > 2  25/07/2012 1
> > 3  26/07/2012 1
> > 4  27/07/2012 1
> > 5  28/07/2012 1
> > 6  24/07/2012-1
> > 7  25/07/2012-1
> > 8  26/07/2012-1
> > 9  27/07/2012 1
> > 10 28/07/2012-1
> >
> > I wish to collapse it into a smaller one based on the state value. If
> state
> > is 1 already then the second state (and the row) is to be removed till a
> > new state is found and so on.. States can be 1 or -1 only. So in the
> > previous example the new data frame should be:
> >
> >   Date State  24/07/2012 1  24/07/2012 -1  27/07/2012 1  28/07/2012 -1
>  Can
> > someone help?
> >
> > Thx
> > Raghu
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Collapsing a vector/data-frame based on the previous values

2012-07-24 Thread Raghuraman Ramachandran
That helps a lot mate. Thanks.

On Tue, Jul 24, 2012 at 9:50 AM, Rui Barradas  wrote:

> Hello,
>
> Step by step way:
>
>
> inx <- rle(states$State)$lengths
> inx <- cumsum(c(1, inx))
> inx <- inx[inx <= nrow(states)]
> states[inx, ]
>
> Hope this helps,
>
> Rui Barradas
>
> Em 24-07-2012 07:40, Raghuraman Ramachandran escreveu:
>
>> Hello
>>
>> I have a data frame like this:
>> dput(states)
>> structure(list(Date = c("24/07/2012", "25/07/2012", "26/07/2012",
>> "27/07/2012", "28/07/2012", "24/07/2012", "25/07/2012", "26/07/2012",
>> "27/07/2012", "28/07/2012"), State = c(1L, 1L, 1L, 1L, 1L, -1L,
>> -1L, -1L, 1L, -1L)), .Names = c("Date", "State"), class = "data.frame",
>> row.names = c(NA,
>> -10L))
>>
>>  State
>>>
>>Date State
>> 1  24/07/2012 1
>> 2  25/07/2012 1
>> 3  26/07/2012 1
>> 4  27/07/2012 1
>> 5  28/07/2012 1
>> 6  24/07/2012-1
>> 7  25/07/2012-1
>> 8  26/07/2012-1
>> 9  27/07/2012 1
>> 10 28/07/2012-1
>>
>> I wish to collapse it into a smaller one based on the state value. If
>> state
>> is 1 already then the second state (and the row) is to be removed till a
>> new state is found and so on.. States can be 1 or -1 only. So in the
>> previous example the new data frame should be:
>>
>>Date State  24/07/2012 1  24/07/2012 -1  27/07/2012 1  28/07/2012 -1
>>  Can
>> someone help?
>>
>> Thx
>> Raghu
>>
>> [[alternative HTML version deleted]]
>>
>> __**
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Collapsing a vector/data-frame based on the previous values

2012-07-23 Thread Raghuraman Ramachandran
Hello

I have a data frame like this:
dput(states)
structure(list(Date = c("24/07/2012", "25/07/2012", "26/07/2012",
"27/07/2012", "28/07/2012", "24/07/2012", "25/07/2012", "26/07/2012",
"27/07/2012", "28/07/2012"), State = c(1L, 1L, 1L, 1L, 1L, -1L,
-1L, -1L, 1L, -1L)), .Names = c("Date", "State"), class = "data.frame",
row.names = c(NA,
-10L))

> State

  Date State
1  24/07/2012 1
2  25/07/2012 1
3  26/07/2012 1
4  27/07/2012 1
5  28/07/2012 1
6  24/07/2012-1
7  25/07/2012-1
8  26/07/2012-1
9  27/07/2012 1
10 28/07/2012-1

I wish to collapse it into a smaller one based on the state value. If state
is 1 already then the second state (and the row) is to be removed till a
new state is found and so on.. States can be 1 or -1 only. So in the
previous example the new data frame should be:

  Date State  24/07/2012 1  24/07/2012 -1  27/07/2012 1  28/07/2012 -1  Can
someone help?

Thx
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Raghuraman Ramachandran
Thx Jeff. I could use a loop no doubt but I thought that will reduce the
speed and I was thinking there could be a vectorisation idea. I will try
your way. Cheers.

On Sat, Jul 14, 2012 at 3:51 PM, Jeff Newmiller wrote:

> You have to wrap the write calls in some kind of loop. For your example,
> you could use a for loop. If you have multiple rows of one name you might
> look into the dlply function from the plyr package and use lapply to do the
> actual write calls.
> ---
> Jeff NewmillerThe .   .  Go Live...
> DCN:Basics: ##.#.   ##.#.  Live
> Go...
>   Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
> /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> Raghuraman Ramachandran  wrote:
>
> >GuRus
> >
> >How do I use the write function (or write.table or write.csv) to
> >achieve
> >the following please?
> >
> >age=c(32,37,39)
> >names=c("john","peter","jake")
> >
> >I would like create in a directory 3 files each named as
> >john.csv,peter.csv
> >and jake.csv and each file have data from the age vector. That is
> >jon.csv
> >will contain 32, peter.csv will contain 37 and jake.csv will contain
> >39.
> >
> >Thanks for the help.
> >
> >Raghu
> >
> >   [[alternative HTML version deleted]]
> >
> >__
> >R-help@r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Raghuraman Ramachandran
In the same context I tried the following but with no results.

mywrite=function(a,b){
write.csv(a,paste(b,".csv")
}
lapply(age,mywrite(age,names))

which produced:
Error in cat(list(...), file, sep, fill, labels, append) :
  argument 1 (type 'list') cannot be handled by 'cat'

Thanks once again.
Raghu

On Sat, Jul 14, 2012 at 3:22 PM, Raghuraman Ramachandran <
optionsra...@gmail.com> wrote:

> GuRus
>
> How do I use the write function (or write.table or write.csv) to achieve
> the following please?
>
> age=c(32,37,39)
> names=c("john","peter","jake")
>
> I would like create in a directory 3 files each named as
> john.csv,peter.csv and jake.csv and each file have data from the age
> vector. That is jon.csv will contain 32, peter.csv will contain 37 and
> jake.csv will contain 39.
>
> Thanks for the help.
>
> Raghu
>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] writing data into files whose names are in a vector

2012-07-14 Thread Raghuraman Ramachandran
GuRus

How do I use the write function (or write.table or write.csv) to achieve
the following please?

age=c(32,37,39)
names=c("john","peter","jake")

I would like create in a directory 3 files each named as john.csv,peter.csv
and jake.csv and each file have data from the age vector. That is jon.csv
will contain 32, peter.csv will contain 37 and jake.csv will contain 39.

Thanks for the help.

Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help with vectors and rollapply

2012-07-11 Thread Raghuraman Ramachandran
Hi Bill

Many thanks for your help.

Cheers
R

-Original Message-
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: 10 July 2012 17:22
To: Raghuraman Ramachandran; r-help@r-project.org
Subject: RE: Help with vectors and rollapply

It looks like you already have the zoo package loaded so you can use its 
na.locf(), which replaces NA's with the last non-NA value.  Convert the 0s to 
NAs with
replace() and feed the result into na.locf():
  a  <- c(-2,0,0,0,1,0,0,3,0,0,-4)
  aOut <- c(-2,-2,-2,-2,1,1,1,3,3,3,-4)
  na.locf(replace(a, a==0, NA) )
  #  [1] -2 -2 -2 -2  1  1  1  3  3  3 -4
  all.equal(aOut, .Last.value)
  # [1] TRUE

If you need to treat NA and 0 differently you will need to do more work.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Raghuraman
> Ramachandran
> Sent: Tuesday, July 10, 2012 8:23 AM
> To: r-help@r-project.org
> Subject: [R] Help with vectors and rollapply
>
> Hello
>
> I have a vector a =(-2,0,0,0,1,0,0,3,0,0,-4)
>
> I want to replace all zeros into previous non-zero state. So for
> instance the above vector should be converted into:
>
> a= (-2,-2,-2,-2,1,1,1,3,3,3,-4)
>
> I tried many things and finally concluded that probably(?) rollapply
> may be the best way?
>
> I tried
> f= function(x){
> ifelse(x==0,Lag(x),x)
> }
>
> And then, rollappy(a,1,f) and that didn't work. Can someone help please?
>
> Thx
> R
>
>
> Jefferies archives and monitors outgoing and incoming e-mail. The
> contents of this email, including any attachments, are confidential to
> the ordinary user of the email address to which it was addressed. If
> you are not the addressee of this email you may not copy, forward,
> disclose or otherwise use it or any part of it in any form whatsoever.
> Since the confidentiality of Internet e-mail cannot be guaranteed,
> please do not include private or confidential information (such as
> account numbers) or instructions requiring your authorization (such as
> orders or funds transfers) in your e-mail communication to us. This
> email may be produced at the request of regulators or in connection
> with civil litigation. Jefferies accepts no liability for any errors
> or omissions arising as a result of transmission. Although this transmission 
> and any attachments are believed to be free of any virus or other defect that 
> might affect any computer system into which it is received and opened, it is 
> the!
>   responsibility of the recipient to ensure that it is virus free and
> no responsibility is accepted by Jefferies, its subsidiaries and
> affiliates, as applicable, for any loss or damage arising in any way
> from its use. In the United Kingdom, Jefferies operates as Jefferies
> International Limited; registered in England: no. 1978621; and
> Jefferies Bache Limited; registered in England: no. 114226; registered
> office for both: Vintners Place, 68 Upper Thames Street, London EC4V
> 3BJ. Jefferies International Limited and Jefferies Bache Limited are
> authorised and regulated by the Financial Services Authority. If you
> received this transmission in error, please immediately contact the sender 
> and destroy the material in its entirety, whether in electronic or hard copy 
> format. Thank you.
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Jefferies archives and monitors outgoing and incoming e-mail. The contents of 
this email, including any attachments, are confidential to the ordinary user of 
the email address to which it was addressed. If you are not the addressee of 
this email you may not copy, forward, disclose or otherwise use it or any part 
of it in any form whatsoever. Since the confidentiality of Internet e-mail 
cannot be guaranteed, please do not include private or confidential information 
(such as account numbers) or instructions requiring your authorization (such as 
orders or funds transfers) in your e-mail communication to us. This email may 
be produced at the request of regulators or in connection with civil 
litigation. Jefferies accepts no liability for any errors or omissions arising 
as a result of transmission. Although this transmission and any attachments are 
believed to be free of any virus or other defect that might affect any computer 
system into which it is received and opened, it is the!
  responsibility of the recipient to ensure that it is virus free and no 
responsibility is a

[R] Help with vectors and rollapply

2012-07-10 Thread Raghuraman Ramachandran
Hello

I have a vector a =(-2,0,0,0,1,0,0,3,0,0,-4)

I want to replace all zeros into previous non-zero state. So for instance the 
above vector should be converted into:

a= (-2,-2,-2,-2,1,1,1,3,3,3,-4)

I tried many things and finally concluded that probably(?) rollapply may be the 
best way?

I tried
f= function(x){
ifelse(x==0,Lag(x),x)
}

And then, rollappy(a,1,f) and that didn't work. Can someone help please?

Thx
R


Jefferies archives and monitors outgoing and incoming e-mail. The contents of 
this email, including any attachments, are confidential to the ordinary user of 
the email address to which it was addressed. If you are not the addressee of 
this email you may not copy, forward, disclose or otherwise use it or any part 
of it in any form whatsoever. Since the confidentiality of Internet e-mail 
cannot be guaranteed, please do not include private or confidential information 
(such as account numbers) or instructions requiring your authorization (such as 
orders or funds transfers) in your e-mail communication to us. This email may 
be produced at the request of regulators or in connection with civil 
litigation. Jefferies accepts no liability for any errors or omissions arising 
as a result of transmission. Although this transmission and any attachments are 
believed to be free of any virus or other defect that might affect any computer 
system into which it is received and opened, it is the!
  responsibility of the recipient to ensure that it is virus free and no 
responsibility is accepted by Jefferies, its subsidiaries and affiliates, as 
applicable, for any loss or damage arising in any way from its use. In the 
United Kingdom, Jefferies operates as Jefferies International Limited; 
registered in England: no. 1978621; and Jefferies Bache Limited; registered in 
England: no. 114226; registered office for both: Vintners Place, 68 Upper 
Thames Street, London EC4V 3BJ. Jefferies International Limited and Jefferies 
Bache Limited are authorised and regulated by the Financial Services Authority. 
If you received this transmission in error, please immediately contact the 
sender and destroy the material in its entirety, whether in electronic or hard 
copy format. Thank you.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help in Optimization of a function

2012-07-08 Thread Raghuraman Ramachandran
guRus!

I have a function f = exp(x^2-y+(1/z))

Also, x can take values from 1 to 37, y from 2 to 20 and Z from -13 to 51.

How can I find the maximum of f using any of the optimization functions
please?

Is there a way to store the possible values of x, y and Z in a single
variable like in a List or in a multi-dimensional array?

Thanks for your help
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Profit calculation

2012-06-19 Thread Raghuraman Ramachandran
Dear guRus

Say I have a price vector, P which is P = c(20,50,40,50) for four
consecutive days.

My initial equity is say $100 and I re-invest the profits made in each
transaction so my equity curve increases.

If I go Long on day 1, short and short on day 2, long and long on day 3 and
finally short on day 4, how do I calculate the total profits using R?
Basically I stay invested at all times.

I have simplified a larger problem by giving a small example.

Thanks for your kind guidance in advance.

Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Raghuraman Ramachandran
I also tried:

> test$Date=as.POSIXct(test$Date,format="%m%d%y")
> test=cbind(test,day.of.week=format(test$Date,format="%A"))
> head(test)
  Date Open High  Low Close   Volume Adj.Close day.of.week
1  2.33 2.34 2.31  2.31  5366000  2.31
2  2.35 2.36 2.33  2.35  5382000  2.35
3  2.35 2.38 2.34  2.36  9606000  2.36
4  2.34 2.34 2.30  2.33  9596000  2.33
5  2.32 2.35 2.31  2.31  5941000  2.31
6  2.34 2.36 2.32  2.32 10332000  2.32

It didnt help.

Thx
Raghu

On Sun, Apr 22, 2012 at 6:41 PM, Jeff Newmiller wrote:

> On Sun, 22 Apr 2012, Hasan Diwan wrote:
>
> Raghu,
>>
>> On 22 April 2012 09:53, Raghuraman Ramachandran > >wrote:
>>
>> I have a data frame (from CSV file) which has its first column called
>>> Date.
>>> The Date is in the format mm/dd/. I was trying to get the weekday for
>>> these dates and I tried using wday() and day.of.week() functions and both
>>> of them gave me precisely the wrong answers. I think the issue lies in
>>> the
>>> proper formatting of dates. The class of this column is a factor class
>>> and
>>> hence I tried converting into POSIXlt, xts, zoo objects and yet I could
>>> not
>>> get the weekday correctly. Anyone has any suggestions please?
>>>
>>>
>> Try this:
>> # assume dataIn is where the CSV files data is...
>> dataIn$Date <- as.POSIXct(dataIn$Date, format='%m/%d/%y')
>>
>
> By far the most common error I see is failing to import the Date column as
> character, instead allowing the import function to convert it to factor,
> after which computations (such as the above suggestion) use the hidden
> factor index instead of the visible character representation, which further
> mystifies beginners.  The conversion above will only work correctly if the
> column was imported as character.  E.g.
>
> dataIn <- read.csv( file="yourdatafile", as.is=TRUE )
>
> OP: Use the str() function to see what types you are working with, and in
> future R-help queries send dput() of the data and code you have tried if we
> are to be able to reproduce your attempts effectively rather than reading
> your mind.
>
>
> dataIn <- cbind(dataIn, day.of.week = format(dataIn$Date, format='%A')
>>
>
> Why not just
>
> dataIn$day.of.week <- weekdays( dataIn$Date )
>
> ?
>
> --**--**
> ---
> Jeff NewmillerThe .   .  Go Live...
> DCN:Basics: ##.#.   ##.#.  Live
> Go...
>  Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
> /Software/Embedded Controllers)   .OO#.   .OO#.
>  rocks...1k
>
>
> __**
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html <http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Raghuraman Ramachandran
2/10/2010", "21/10/2010", "20/10/2010", "19/10/2010", "18/10/2010",
"15/10/2010", "14/10/2010", "13/10/2010", "12/10/2010", "11/10/2010",
"08/10/2010", "07/10/2010", "06/10/2010", "05/10/2010", "04/10/2010",
"01/10/2010", "30/09/2010", "29/09/2010", "28/09/2010", "27/09/2010",
"24/09/2010", "23/09/2010", "22/09/2010", "21/09/2010", "20/09/2010",
"17/09/2010", "16/09/2010", "15/09/2010", "14/09/2010", "13/09/2010",
"09/09/2010", "08/09/2010", "07/09/2010", "06/09/2010", "03/09/2010",
"02/09/2010", "01/09/2010", "31/08/2010", "30/08/2010", "27/08/2010",
"26/08/2010", "25/08/2010", "24/08/2010", "23/08/2010", "20/08/2010",
"19/08/2010", "18/08/2010", "17/08/2010", "16/08/2010", "13/08/2010",
"12/08/2010", "11/08/2010", "10/08/2010", "06/08/2010", "05/08/2010",
"04/08/2010", "03/08/2010", "02/08/2010", "30/07/2010", "29/07/2010",
"28/07/2010", "27/07/2010", "26/07/2010", "23/07/2010", "22/07/2010",
"21/07/2010", "20/07/2010", "19/07/2010", "16/07/2010", "15/07/2010",
"14/07/2010", "13/07/2010", "12/07/2010", "09/07/2010", "08/07/2010",
"07/07/2010", "06/07/2010", "05/07/2010", "02/07/2010", "01/07/2010",
"30/06/2010", "29/06/2010", "28/06/2010", "25/06/2010", "24/06/2010",
"23/06/2010", "22/06/2010", "21/06/2010", "18/06/2010", "17/06/2010",
"16/06/2010", "15/06/2010", "14/06/2010", "11/06/2010", "10/06/2010",
"09/06/2010", "08/06/2010", "07/06/2010", "04/06/2010", "03/06/2010",
"02/06/2010", "01/06/2010", "31/05/2010", "27/05/2010", "26/05/2010",
"25/05/2010", "24/05/2010", "21/05/2010", "20/05/2010", "19/05/2010",
"18/05/2010", "17/05/2010", "14/05/2010", "13/05/2010", "12/05/2010",
"11/05/2010", "10/05/2010", "07/05/2010", "06/05/2010", "05/05/2010",
"04/05/2010", "03/05/2010", "30/04/2010", "29/04/2010", "28/04/2010",
"27/04/2010", "26/04/2010", "23/04/2010", "22/04/2010", "21/04/2010",
"20/04/2010", "19/04/2010", "16/04/2010", "15/04/2010", "14/04/2010",
"13/04/2010", "12/04/2010", "09/04/2010", "08/04/2010", "07/04/2010",
"06/04/2010", "05/04/2010", "01/04/2010", "31/03/2010", "30/03/2010",
"29/03/2010", "26/03/2010", "25/03/2010", "24/03/2010", "23/03/2010",
"22/03/2010", "19/03/2010", "18/03/2010", "17/03/2010", "16/03/2010",
"15/03/2010", "12/03/2010", "11/03/2010", "10/03/2010", "09/03/2010",
"08/03/2010", "05/03/2010", "04/03/2010", "03/03/2010", "02/03/2010",
"01/03/2010", "26/02/2010", "25/02/2010", "24/02/2010", "23/02/2010",
"22/02/2010", "19/02/2010", "18/02/2010", "17/02/2010", "12/02/2010",
"11/02/2010", "10/02/2010", "09/02/2010", "08/02/2010", "05/02/2010",
"04/02/2010", "03/02/2010", "02/02/2010", "01/02/2010", "29/01/2010",
"28/01/2010", "27/01/2010", "26/01/2010", "25/01/2010", "22/01/2010",
"21/01/2010", "20/01/2010", "19/01/2010", "18/01/2010", "15/01/2010",
"14/01/2010", "13/01/2010", "12/01/2010", "11/01/2010", "08/01/2010",
"07/01/2010", "06/01/2010", "05/01/2010", "04/01/2010", "31/12/2009",
"30/12/2009", "29/12/2009", "28/12/2009", "24/12/2009", "23/12/2009",
"22/12/2009", "21/12/2009", "18/12/2009", "17/12/2009", "16/12/2009",
"15/12/2009", "14/12/2009", "11/12/2009", "10/12/2009", "09/12/2009",
"08/12/2009", "07/12/2009", "04/12/2009", "03/12/2009", "02/12/2009",
"01/12/2009", "30/11/2009", "26/11/2009", "25/11/2009", "24/11/2009",
"23/11/2009", "20/11/2009", "19/11/2009", "18/11/2009", "17/11/2009",
"16/11/2009", "13/11/2009", "12/11/2009", "11/11/2009", "10/11/2009",
"09/11/2009", "06/11/2009", "05/11/2009", "04/11/2009", "03/11/2009",
"02/11/2009", "30/10/2009", "29/10/2009", "28/10/2009", "27/10/2009",
"26/10/2009", "23/10/2009", "22/10/2009", "21/10/2009", "20/10/2009",
"19/10/2009", "16/10/2009", "15/10/2009", "14/10/2009", "13/10/2009",
"12/10/2009", "09/10/2009", "08/10/2009", "07/10/2009", "06/10/2009",
"05/10/2009", "02/10/2009", "01/10/2009", "30/09/2009", "29/09/2009",
"28/09/2009", "25/09/2009", "24/09/2009", "23/09/2009", "22/09/2009",
"18/09/2009", "17/09/2009", "16/09/2009", "15/09/2009", "14/09/2009",
"11/09/2009", "10/09/2009", "09/09/2009", "08/09/2009", "07/09/2009",
"04/09/2009", "03/09/2009", "02/09/2009", "01/09/2009", "31/08/2009",
"28/08/2009", "27/08/2009", "26/08/2009", "25/08/2009", "24/08/2009",
"21/08/2009", "20/08/2009", "19/08/2009", "18/08/2009", "17/08/2009",
"14/08/2009", "13/08/2009", "12/08/2009", "11/08/2009", "07/08/2009",
"06/08/2009", "05/08/2009", "04/08/2009", "03/08/2009", "31/07/2009",
"30/07/2009", "29/07/2009", "28/07/2009", "27/07/2009", "24/07/2009",
"23/07/2009", "22/07/2009", "21/07/2009", "20/07/2009", "17/07/2009",
"16/07/2009", "15/07/2009", "14/07/2009", "13/07/2009", "10/07/2009",
"09/07/2009", "08/07/2009", "07/07/2009", "06/07/2009", "03/07/2009",
"02/07/2009", "01/07/2009", "30/06/2009", "29/06/2009", "26/06/2009",
"25/06/2009", "24/06/2009", "23/06/2009", "22/06/2009", "19/06/2009",
"18/06/2009", "17/06/2009", "16/06/2009", "15/06/2009", "12/06/2009",
"11/06/2009", "10/06/2009", "09/06/2009", "08/06/2009", "05/06/2009",
"04/06/2009", "03/06/2009", "02/06/2009", "01/06/2009", "29/05/2009",
"28/05/2009", "27/05/2009", "26/05/2009", "25/05/2009", "22/05/2009",
"21/05/2009", "20/05/2009", "19/05/2009", "18/05/2009", "15/05/2009",
"14/05/2009", "13/05/2009", "12/05/2009", "11/05/2009", "08/05/2009",
"07/05/2009", "06/05/2009", "05/05/2009", "04/05/2009", "30/04/2009",
"29/04/2009", "28/04/2009", "27/04/2009", "24/04/2009", "23/04/2009",
"22/04/2009", "21/04/2009", "20/04/2009", "17/04/2009", "16/04/2009",
"15/04/2009", "14/04/2009", "13/04/2009", "09/04/2009", "08/04/2009",





On Sun, Apr 22, 2012 at 6:41 PM, Jeff Newmiller wrote:

> On Sun, 22 Apr 2012, Hasan Diwan wrote:
>
> Raghu,
>>
>> On 22 April 2012 09:53, Raghuraman Ramachandran > >wrote:
>>
>> I have a data frame (from CSV file) which has its first column called
>>> Date.
>>> The Date is in the format mm/dd/. I was trying to get the weekday for
>>> these dates and I tried using wday() and day.of.week() functions and both
>>> of them gave me precisely the wrong answers. I think the issue lies in
>>> the
>>> proper formatting of dates. The class of this column is a factor class
>>> and
>>> hence I tried converting into POSIXlt, xts, zoo objects and yet I could
>>> not
>>> get the weekday correctly. Anyone has any suggestions please?
>>>
>>>
>> Try this:
>> # assume dataIn is where the CSV files data is...
>> dataIn$Date <- as.POSIXct(dataIn$Date, format='%m/%d/%y')
>>
>
> By far the most common error I see is failing to import the Date column as
> character, instead allowing the import function to convert it to factor,
> after which computations (such as the above suggestion) use the hidden
> factor index instead of the visible character representation, which further
> mystifies beginners.  The conversion above will only work correctly if the
> column was imported as character.  E.g.
>
> dataIn <- read.csv( file="yourdatafile", as.is=TRUE )
>
> OP: Use the str() function to see what types you are working with, and in
> future R-help queries send dput() of the data and code you have tried if we
> are to be able to reproduce your attempts effectively rather than reading
> your mind.
>
>
> dataIn <- cbind(dataIn, day.of.week = format(dataIn$Date, format='%A')
>>
>
> Why not just
>
> dataIn$day.of.week <- weekdays( dataIn$Date )
>
> ?
>
> --**--**
> ---
> Jeff NewmillerThe .   .  Go Live...
> DCN:Basics: ##.#.   ##.#.  Live
> Go...
>  Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
> /Software/Embedded Controllers)   .OO#.   .OO#.
>  rocks...1k
>
>
> __**
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html <http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] difficulty in Formatting time series data

2012-04-22 Thread Raghuraman Ramachandran
Dear R-Gurus

I have a data frame (from CSV file) which has its first column called Date.
The Date is in the format mm/dd/. I was trying to get the weekday for
these dates and I tried using wday() and day.of.week() functions and both
of them gave me precisely the wrong answers. I think the issue lies in the
proper formatting of dates. The class of this column is a factor class and
hence I tried converting into POSIXlt, xts, zoo objects and yet I could not
get the weekday correctly. Anyone has any suggestions please?

Many thanks
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Creating timeSeries

2010-08-06 Thread Raghuraman Ramachandran
?xts

xts will do what you want. as.xts or xts() are straightforward ways.

On Fri, Aug 6, 2010 at 5:11 PM, Serdar Akin  wrote:

> Hi
>
> I want to create a TimeSeries object with already defined dates (in the
> first vector) so that all the data are coerced as a time series object with
> the dates as they are.
>
> Is there anyone that have an idea what to do?
>
> 2010-07-07 3.900833 3.176667 2.754167 2.045833 1.820833
> 2010-04-21 4.256667 3.356667 2.70 1.82 1.576667
> 2010-02-17 4.322500 3.45 2.67 1.792500 1.492500
> 2009-12-23 4.306667 3.426667 2.68 1.851667 1.481667
> 2009-10-28 4.34 3.425000 2.677500 2.17 1.522500
> 2009-09-09 4.472500 3.41 2.64 2.17 1.645000
>
> Serdar (MA)
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to apply apply?!

2010-08-06 Thread Raghuraman Ramachandran
guRus

I have say a dataframe, d and I wish to do the following:

1) For each row, I want to take one particular value of the row and multiply
it by 2. How do I do it. Say the data frame is as below:
   OPEN HIGH LOW CLOSE 1931.2 1931.2 1931.2 1931.2 0 0 0 999.05 0 0 0 1052.5
0 0 0 987.8 0 0 0 925.6 0 0 0 866 0 0 0 1400.2 0 0 0 754.5 0 0 0 702.6 0 0 0
653.25 0 0 0 348 0 0 0 801 866.55 866.55 866.55 866.55 783.1 783.1 742.25
742.25 575 575 575 575 0 0 0 493 470 470 420 425 355 360 343 360 312.05
312.05 274 280.85 257.35 257.35 197 198.75 182 185.95 137 150.75 120.25 129
90.7 101.25 91.85 91.85 57 66.6

How do I multiply only the close of every row using the 'apply' function?
And once multiplied how do I obtain a new table that also contains the new
2*CLOSE column (without cbind?).

2) Also, how do I run a generic function per row. Say for example I want to
calculate the Implied Volatility for each row of this data frame ( using the
RMterics package). How do I do that please using the apply function? I am
focusing on apply because I like the vectorisation concept in R and I do not
want to use a for loop etc.

Many thanks for the enlightment,
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to read a file inside a function?

2010-08-06 Thread Raghuraman Ramachandran
Hi

I wish to read a file from my local directory from inside a function. I am
passing the filename as the argument but this does not work.
Say for example
function(dat)
{
dat1=read.csv("D:\\dat.csv",header=TRUE)
}
If I call funtion(dat) I get the following error. 'Intuitively' i understand
this is a mistake but how do I overcome this and how can I read a file name
passed as an argument please?


Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'D:\dat.csv': No such file or directory

Many thanks
Raghu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.