Re: [R] how to subtract one string from another in R

2011-06-18 Thread Santosh Srinivas
Hello Vijayan, Depending on your end goal the following could possibly help substr(string,nchar(string1)+1, nchar(string)) or strsplit(string," ") HTH, Santosh On Sat, Jun 18, 2011 at 2:06 PM, Vijayan Padmanabhan wrote: > Dear R Group > Here is what i am trying to do.. but couldnt figure ou

Re: [R] Can we prepare a questionaire in R

2011-06-09 Thread Santosh Srinivas
You question has multiple answers that you can choose from and the group has been trying to help you. My suggestion would be to write it to the database using PHP and use R to extract and analyze (and write back) the data. The integration of R with web functionality is quite nascent but the Rapac

Re: [R] Plotting Data Table

2011-06-02 Thread Santosh Srinivas
Hello cmaster1331, I had asked a similar question sometime back. You may want to check out these responses that I got. A) http://code.google.com/p/gridextra/wiki/tableGrob B) 1) latex (via xtable, Hmisc, r2lh, reporttools ...) 2) html (via xtable, r2lh, R2HTML, hwritter, HTMLUtils ...) 3) graphi

Re: [R] Does a data frame have indexes for columns?

2011-05-19 Thread Santosh Srinivas
Check data.table ... It benefits a lot from indexing data in data frames On Thu, May 19, 2011 at 7:41 PM, xiagao1982 wrote: > Hi all, > > I wonder if I can create indexes for columns in a data frame to speed up data > selection by matching column values, just like indexes for large tables in a

Re: [R] Unexpected behaviour as.data.frame

2011-05-16 Thread Santosh Srinivas
Hi Ivan, Take a look dataFrame in R.utils ... is that what you want? from the help file: Examples df <- dataFrame(colClasses=c(a="integer", b="double"), nrow=10) df[,1] <- sample(1:nrow(df)) df[,2] <- rnorm(nrow(df)) print(df) Thanks, Santosh On Mon, May 16, 2011 at 1:42 PM, Ivan Calan

[R] Empty Data Frame

2011-04-27 Thread Santosh Srinivas
Dear Group, Is there a more efficient way to create a data frame structure (using rep I guess?) require(plyr) week <- rdply(10, data.frame(week = 1:52)) names(week) <- c("Year", "Week") week$Year <- week$Year + 2000 Basically trying to create a year and week data frame to start appending data t

Re: [R] Second largest element from each matrix row

2011-04-26 Thread Santosh Srinivas
would this work (shorter)? apply(a, 1, function(x) x[order(x)[2]]) On Tue, Apr 26, 2011 at 5:31 PM, Lars Bishop wrote: > Hi, > > I need to extract the second largest element from each row of a > matrix. Below is my solution, but I think there should be a more efficient > way to accomplish the s

Re: [R] rownames in an apply function

2011-04-19 Thread Santosh Srinivas
Thanks. On Tue, Apr 19, 2011 at 5:16 PM, Gabor Grothendieck wrote: > On Tue, Apr 19, 2011 at 6:59 AM, santosh wrote: >> Dear Group, >> >> I am doing an apply function on a zoo object. I need the rownames to >> be passed to the function. >> Any suggestions on how to accomplish this? >> >> Here is

[R] Print out data frames into neat images

2011-04-17 Thread Santosh Srinivas
Hi Group, I often need to print out data frames with results of analysis into a neat little image to copy and paste into documents. I need apply formatting like bold, currency signs, number formats, header shading etc. I currently output the data into csv and format using good old excel. Any sugg

[R] Flexible rbind

2011-03-17 Thread Santosh Srinivas
Sender: r-help-boun...@r-project.org On-Behalf-Of: santosh.srini...@gmail.com Subject: [R] Flexible rbind Message-Id: Recipient: killian.door...@barclayscapital.com ___ e at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent fr

[R] Flexible rbind

2011-03-17 Thread Santosh Srinivas
Sender: r-help-boun...@r-project.org On-Behalf-Of: santosh.srini...@gmail.com Subject: [R] Flexible rbind Message-Id: Recipient: simon.r...@barclayscapital.com ___ e at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from ot

[R] Flexible rbind

2011-03-17 Thread Santosh Srinivas
Dear All, I am trying to create a empty structure that I want to fill gradually through the code. I want to use something like rbind to create the basic structure first. I am looking for a possibility to do an rbind where the columns names dont match fully (but the missing columns can be defaulte

Re: [R] Rearranging the data

2011-03-09 Thread Santosh Srinivas
reshape2 Like this? > require(reshape2) Loading required package: reshape2 > melt(xx) Using country as id variables country variable value 1 USAx10 2 UKx50 3 Canadax20 4 USAy40 5 UKy80 6 Canaday35 7 U

Re: [R] How to Save R library data into xls or dta format

2011-03-01 Thread Santosh Srinivas
for excel .. see library(xlsx) On Tue, Mar 1, 2011 at 2:57 PM, JoonGi wrote: > > Thanks in advance. > > I'm having a trouble with data saving. > > I want to run the same data which is in Ecdat library at different statistic > programs(excel, stata and matlab) > > The data I want to use is > > lib

[R] read.table

2011-02-22 Thread Santosh Srinivas
Hi Group, I am having a strange problem for this simple task. I am using read.table to read a plan 3 column CSV file . the file is getting read . But the first column has datetime in the csv file in the following format: 20110221.114041 But this is being read as 20110221 only . the tim

Re: [R] delete rows

2011-02-06 Thread Santosh Srinivas
?subset On Mon, Feb 7, 2011 at 7:46 AM, Christopher Porter wrote: > Hello. I came across your response in an R forum and could use your help. I > have a data set with 472 rows. I want to delete rows 416 through 472. The > name of my data set is MERGE. > > I am an extreme R novice. How do I writ

Re: [R] Finding a Diff within a Dataframe columns

2011-01-30 Thread Santosh Srinivas
Please take a look at the introduction to R too ... > df <- read.delim(textConnection(Lines),sep="") > df A B CD 1 0.1 0.7 0.9 0.80 2 0.2 0.6 0.8 0.70 3 0.4 0.8 0.7 0.76 > d['A-B'] <- with(df, A-B) Error in d["A-B"] <- with(df, A - B) : object 'd' not found > d$v1 <- with(df, A-B) Erro

Re: [R] which operating system + computer specifications lead to the best performance for R?

2011-01-22 Thread Santosh Srinivas
Hi Marc, I've exactly the same question and it looks like most of the heavy users from the threads I've followed use Unix/Linux/Mac. Some threads have given rationale for a 64bit system due to memory benefits but there seems to be not much buy-in from the guys here (so I'd give that a pass). The C

Re: [R] Using subset to filter data table

2011-01-19 Thread Santosh Srinivas
tcc.new2 <- droplevels(tcc.new) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben Harrison Sent: 19 January 2011 12:24 To: r-help@r-project.org Subject: [R] Using subset to filter data table I am having difficulty understanding ho

[R] snowfall

2011-01-12 Thread Santosh Srinivas
Hello, Just wondering why I am unable to run this in parallel. A dput of my dataset is attached at the end. Please use to create my data object. I want to run this function in parallel (not sure if this is an efficient implementation): #Function to calculate the time to maturity for the option r

Re: [R] Basic ggplot question

2011-01-10 Thread Santosh Srinivas
2011 18:59 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Basic ggplot question Hi, Try this, m = melt(dat, id="Date") head(m) qplot(Date, value, data=m, colour=variable, geom="line") ggplot(m) + facet_grid(variable~., scales="free_y") + geom_path

[R] Basic ggplot question

2011-01-10 Thread Santosh Srinivas
Hello R-Group, I am trying plotting simple time-series with ggplot2 because the output looks better and I've heard its richer in features. I have the following dataset. > dput(dat) structure(list(Date = structure(c(14970, 14971, 14972, 14973, 14974, 14977, 14978, 14979, 14980, 14981), class = "D

Re: [R] Rapache on windows

2010-12-13 Thread Santosh Srinivas
; > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Santosh Srinivas > Sent: Saturday, December 11, 2010 8:37 AM > To: r-help@r-project.org > Subject: [R] Rapache on windows > > Hello all, > > I sear

[R] toJSON question

2010-12-11 Thread Santosh Srinivas
Hello, I am trying to use RJSONIO I have: x <- c(0,4,8,9) y <- c(3,8,5,13) z <- cbind(x,y) Any idea how to convert z into the JSON format below? I want to get the following JSON output to put into a php file. [[0, 3], [4, 8], [8, 5], [9, 13]] Thank you. __

[R] simple payoff function

2010-12-11 Thread Santosh Srinivas
Just wondering if there is a better way to do this? x <- seq(4,20,1) y <- sapply(x, function(x) (max(x-10,0))) Is there a easier way to get to y? i.e. max(x-10,0) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] Rapache on windows

2010-12-11 Thread Santosh Srinivas
Hello all, I searched on the www but could not find installation instructution for rapache on windows. The page says that the release runs on UNIX/Linux and Mac OS X operating systems. Has anyone been able to configure it on windows? Any idea how to go about it? Thank you. __

Re: [R] hi have a question about merging.

2010-12-08 Thread Santosh Srinivas
Try this male.df <- subset(raceprofiling, (male==1)) female.df <- subset(raceprofiling, (male==0)) people.df <- rbind(male.df,female.df) works? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of tanzia chaudhury Sent: 09 December 2010

Re: [R] One question about R

2010-12-08 Thread Santosh Srinivas
Why 2.8? You should perhaps go for 2.12 ... I like 2.11 right now because most of my work has been tested on it already and it is quite stable with other packages. But, the ideally you should go for 2.12 which is the most recent release and has substantial enhancements. Then you should post the e

Re: [R] Time out for a R Function

2010-12-08 Thread Santosh Srinivas
osh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Time out for a R Function On Tue, 7 Dec 2010, Santosh Srinivas wrote: > Hello Group, > > I have an R-function that works fine for most part but sometime runs into a > long loop! (I'm lazy and short on time to debug right now so wa

Re: [R] Creating binary variable depending on strings of two dataframes

2010-12-07 Thread Santosh Srinivas
your question is not clear to me .. but your solution is a variation of > data1$x.1 <- data1$x1 %in% data2$y1 you can play with your conditions to get the result you want On Tue, Dec 7, 2010 at 10:00 PM, Pete Pete wrote: > > Hi, > consider the following two dataframes: > x1=c("232","3454","3455

[R] Time out for a R Function

2010-12-06 Thread Santosh Srinivas
Hello Group, I have an R-function that works fine for most part but sometime runs into a long loop! (I'm lazy and short on time to debug right now so want to do something easy) For my purpose, it is ok to make few errors is there a way I can put a timeout on a function and the r-process neede

Re: [R] merging two vectors

2010-12-05 Thread Santosh Srinivas
unique(c(x,y)) On Sun, Dec 5, 2010 at 8:27 PM, ram basnet wrote: > Dear R users, > > It may be very simple but it is being difficult for me. > I have two vectors with some common string. And, i want to combine into a > vector in such a way that it includes string from both vectors and make a >

[R] foreach question

2010-12-05 Thread Santosh Srinivas
Hello Group, I am experimenting with parallel processing ... here is part of my code. require(snow) require(doSNOW) require(foreach) cl.tmp = makeCluster(rep("localhost",4), type="SOCK") registerDoSNOW(cl.tmp) foreach(i=1:NROW(sDat),.packages="gdata",.verbose=TRUE) %dopar% { do somethin

[R] grep for strings

2010-12-04 Thread Santosh Srinivas
I am trying to find the function where I can search for a pattern in a text string (I thought I could use grep for this but no :(). > x [1] "abcdefghijkl" I want to find the positions (i.e. equivalent of nchar) for "cd" and in case there are multiple hits .. then the results as a array Thank you

[R] data.table query

2010-12-03 Thread Santosh Srinivas
Hello Group, I need a modification in the data.table example to get my intended result shown below ... is there a more simple way! dt <- data.table(A = rep(1:3, each=4), B = rep(1:4, each=3), C = rep(1:2, 6)) dt[, transform(.SD,D=mean(A)), by="B"] The result I want is below ... which is probabl

[R] intraday zoo

2010-12-03 Thread Santosh Srinivas
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.41

[R] Querying a data frame or data.table

2010-12-03 Thread Santosh Srinivas
Hello Group, Is there an easy way to query a data.frame or data.table (this is fast!) for multiple conditions? I don't want to use a SQL kind of statement. I am looking for something like a subset with multiple conditions. Any tips of the like the binary search methodology used for data.table wo

Re: [R] colname refered by a variable

2010-12-02 Thread Santosh Srinivas
try this .. df[,colnames(df)==paste("A","C",sep="")] On Fri, Dec 3, 2010 at 12:05 PM, Yuan Jian wrote: > Hello, > > I tried to use a variable to refer colname, but I got error, could anyone > give me advice? > >>df=data.frame(cbind(AB=1:3,AC=3:5)) >> df$AC > [1] 3 4 5 >> df$paste("A","C",sep=""

Re: [R] using foreach (parallel processing)

2010-12-02 Thread Santosh Srinivas
Thanks. I guess I had to wait long enough to get the threads running and now they seem be on top gear. Hope this thing doesn't crash now! On Thu, Dec 2, 2010 at 3:36 PM, Rainer M Krug wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 12/02/2010 10:56 AM, Santo

[R] using foreach (parallel processing)

2010-12-02 Thread Santosh Srinivas
Hello group, I am experimenting with parallel processing on my quad core Win 7 32 bit machine. Using these packages for the first time. I can see all my processor running at full performance when I use a smaller dataset require(snow) require(doSNOW) require(foreach) #change the 8 to however many

[R] Difference between loops and vectorization

2010-11-30 Thread Santosh Srinivas
Hello R-helpers, A fundamental question ...I'm trying to understand the differences between loop and vectorization ... I understand that it should be a natural choice to use apply / adply when it is needed to perform the same function across all rows of a data frame. Any pointers on why this is so

Re: [R] Installing RQuantLib on Win 7 64 Bit

2010-11-26 Thread Santosh Srinivas
To: santosh.srini...@gmail.com From: e...@debian.org CC: r-help@r-project.org Subject: Re: [R] Installing RQuantLib on Win 7 64 Bit On 26 November 2010 at 07:05, Santosh Srinivas wrote: | Hello Group, | | I am trying out RQuantLib on a 64bit Win 7 machine. But running into | installation errors

[R] Installing RQuantLib on Win 7 64 Bit

2010-11-25 Thread Santosh Srinivas
Hello Group, I am trying out RQuantLib on a 64bit Win 7 machine. But running into installation errors install.packages("RQuantLib") Warning in install.packages("RQuantLib") : argument 'lib' is missing: using 'C:\Users\Tester\Documents/R/win64-library/2.11' Warning: unable to access index for r

[R] Finding the nearest data in intraday data from two zoo objects

2010-11-24 Thread Santosh Srinivas
Hello Group, I have the following options and future data in zoo objects > head(optData.z) ExpDt OptTyp Strike TrdPrice TotTrdQty 2009-01-01 09:55:03 20090129 1 2900 180.50 2009-01-01 09:55:31 20090129 1 2900 188.50 2009-01-01 09:55:37

Re: [R] Finding the rows with the duplicated index

2010-11-23 Thread Santosh Srinivas
[mailto:ggrothendi...@gmail.com] Sent: 23 November 2010 21:54 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Finding the rows with the duplicated index On Tue, Nov 23, 2010 at 11:04 AM, Santosh Srinivas wrote: > Hello Group, > > I have a huge time series dataset with sample be

[R] Finding the rows with the duplicated index

2010-11-23 Thread Santosh Srinivas
Hello Group, I have a huge time series dataset with sample below. I am basically trying to read it into a zoo object with columns 1:6 to index. Zoo issues a warning that some of the rows have duplicated index. dput(z) structure(list(TrdTimestamp = structure(list(sec = c(19, 19, 18, 10, 12, 43, 4

[R] Executing multiple .R files

2010-11-23 Thread Santosh Srinivas
Hello R-Helpers, I have a directory with some ".R" files that I execute every day. I want to write a script that executes each one of time sequentially. Is there a statement for this? Thank you. __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Check for is.object

2010-11-22 Thread Santosh Srinivas
Hello, I am trying to recursively append some data from multiple files into a common object For this, I am using in a loop NewObject <- rbind(NewObject,tempObject) For the first loop, obviously there is no NewObject ... so I wanted to do NewObject <- tempObject[0,] Now when it loops again I w

Re: [R] a philosophy R question

2010-11-20 Thread Santosh Srinivas
Not many really care about what it is called but here is what the page says R is `GNU S', a freely available language and environment for statistical computing and graphics which provides a wide variety of statistical and graphical techniques: linear and nonlinear modelling, statistical test

[R] Option to Print with numbers formatted

2010-11-19 Thread Santosh Srinivas
Hello group, I have a data frame called test.df with a bunch of columns. When I do a print(test.df), I want the numbers to appear a pre-defined setting. I believe this can be achieved by sprintf but this needs to be done individually for the data. However, is there an option that I can set so

[R] Accessing variables inside a namespace

2010-11-17 Thread Santosh Srinivas
Hello Group, I am trying to see if there is way to access data that is inside another namespace. For e.g. the addATR function in the quantmod package calculates the ATR using the TTR package and then plots it to the graph. Now since it has already calculated the info that I need, can I access tha

[R] Access DDE Data

2010-11-15 Thread Santosh Srinivas
Hello Group, Is it possible to access DDE data from R? Thanks in advance for any pointers. S __ 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

Re: [R] RMySQL on Windows 2008 64 Bit -Help!

2010-11-13 Thread Santosh Srinivas
I could do that but will have to change all my code. It would be great if I could get RMySQL on the 64 bit machine. -Original Message- From: Ajay Ohri [mailto:ohri2...@gmail.com] Sent: 13 November 2010 14:13 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] RMySQL on

[R] RMySQL on Windows 2008 64 Bit -Help!

2010-11-12 Thread Santosh Srinivas
Dear Group, I'm having lots of problems getting RMySQL on a 64 bit machine. I followed all instructions available but couldn't get it working yet! Please help. See the output below. I did a install of RMySQL binary from the revolution cran source. It seems to have unpacked fine but gives this err

Re: [R] filling a vector with a tapply function applied to another vector

2010-11-12 Thread Santosh Srinivas
You could just create a new data frame with the result and cbind? On Fri, Nov 12, 2010 at 2:11 PM, albechan wrote: > > I have a data frame with three columns. The first one is filled with factors, > the second one with numeric values and the third one is an empty vector. > I need fill the third c

[R] Deploying code as exe

2010-11-12 Thread Santosh Srinivas
Dear Group, Is there some way for me to package a few lines of R-code as exe and have it running in the background? (unable to find info in the archives) Even better if I can package it as an installation and send to my team who do not have any background in programming / R? If they can install a

[R] Time Delay / Wait

2010-11-11 Thread Santosh Srinivas
Hi Group, Is there something like a delay function based on System time or equivalent? I basically am generating a few graphs and I would like to see each graph for say 2mins before moving on to the next one? I can always have an empty for-loop I guess but is there a better way? Thanks, S _

[R] Parallel code runs slower!

2010-11-10 Thread Santosh Srinivas
My parallel code is running slower than my non-parallel code! Can someone pls advise what am I doing wrong here? t and tTA are simple matrices of equal dimensions. #NON PARALLEL CODE nCols=ncol(t) nRows=nrow(t) tTA = matrix(nrow=nRows,ncol=nCols) require(TTR) system.time( for (i in 1:nCols) {

[R] format as percentage

2010-11-10 Thread Santosh Srinivas
Basic question ... checked the help page but the only answer was to use paste! Is there any way to format as %? > degree = c(0.20,0.5) > degree [1] 0.2 0.5 > print(degree) [1] 0.2 0.5 -- Thanks R-

Re: [R] Parsing txt file

2010-11-10 Thread Santosh Srinivas
You could use the following to achieve your objective. To start with ?readLines ?strsplit ?for ?ifelse As you try, you may receive more specific answers for the issues you come up with. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] concatenating a string to a column

2010-11-09 Thread Santosh Srinivas
Try on these lines library(MASS) data(Boston) Boston$crim<-paste(Boston$crim,"Test",sep="-") -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of sachinthaka.abeyward...@allianz.com.au Sent: 10 November 2010 10:39 To: R-help Forum Subject

Re: [R] arrays of arrays

2010-11-09 Thread Santosh Srinivas
Not sure if this is the best way ... but something similar to my question from yesterday that I could solve as follows. > tD <- read.csv("Book1.csv") > tD X0 X0.1 X1 X1.1 X X.1 1 13 5 NA NA NA 2 44 NA NA NA NA 3 7 -1 89 10 6 > x1 <- tD[1,1:3] > > x2 <- tD[2,1:2] > >

Re: [R] Creating a list to store output objects from a recursive loop

2010-11-09 Thread Santosh Srinivas
Figured this out this ways I think outPut <- list(list(result1),list(result2)) -Original Message- From: Santosh Srinivas [mailto:santosh.srini...@gmail.com] Sent: 09 November 2010 14:21 To: 'r-help@r-project.org' Subject: Creating a list to store output objects from a r

[R] Creating a list to store output objects from a recursive loop

2010-11-09 Thread Santosh Srinivas
Dear Group, I am having a function that I am running in a loop that generated two results for each loop The result1 is a zoo object The result2 is a data frame Now I want to put both of them in a list or some structure ... that I can access or output to a file after the loop is done. For e.g.

Re: [R] Row-wise recurive function call

2010-11-09 Thread Santosh Srinivas
Thanks this works. Only, I need to reference in the formula using indexes. -Original Message- From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] Sent: 09 November 2010 13:22 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Row-wise recurive function call try

[R] Row-wise recurive function call

2010-11-08 Thread Santosh Srinivas
Dear Group, I have a following dataset: > a A B C D 1 22 3 31 40 2 26 31 36 32 3 3 7 49 16 4 24 40 27 26 5 20 45 47 0 6 34 43 11 18 7 48 48 24 2 8 3 16 39 48 9 20 49 7 21 10 17 36 47 10 > dput(a) structure(list(A = c(22L, 26L, 3L, 24L, 20L, 34L, 48L, 3L, 20L, 17L), B = c(3

Re: [R] Extracting data only for particular index values from a zoo structure

2010-11-05 Thread Santosh Srinivas
index(mRet),"%m")==11] -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 05 November 2010 20:59 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Extracting data only for particular index values from a zoo structure On Fri, Nov

[R] Extracting data only for particular index values from a zoo structure

2010-11-05 Thread Santosh Srinivas
Hello All, I have a zoo structure as follows: > dput(tMRet) structure(c(0.00138742474397713, -0.0309023681475112, 0.0390276302410908, 0.0832282874685357, -0.00315002033871414, -0.0158548785709138, -0.0410876001496389, -0.0503189291168807, 0.00229628598547049, 0.112348434473647, 0.07600046962546

Re: [R] postForm() in RCurl and library RHTMLForms

2010-11-04 Thread Santosh Srinivas
I don’t have the implementation in the way you want it …. Sorry … but someone here will definitely know The group showed me to do it this way though …. library(zoo) library("RCurl") sNiftyURL = "http://nseindia.com/content/indices/histdata/S&P%20CNX%20NIFTY01-01-2000-02 -11-2010.csv" Nifty_Dat =

Re: [R] Drawing circles on a chart

2010-11-03 Thread Santosh Srinivas
Thanks Barry ... actually the intention was to have areas of the circle depicting the value (radius imputed) -Original Message- From: b.rowling...@googlemail.com [mailto:b.rowling...@googlemail.com] On Behalf Of Barry Rowlingson Sent: 03 November 2010 15:02 To: Santosh Srinivas Cc: r-help

[R] Data transformation

2010-11-03 Thread Santosh Srinivas
Dear Group, Need to do the following transformation: I have the dataset structure(list(Date = structure(1L, .Label = "2010-06-16", class = "factor"), ACC.returns1Day = -0.018524832, ACC.returns5Day = 0.000863931, ACC.returns7Day = -0.019795222, BCC.returns1Day = -0.009861859, BCC.r

Re: [R] Drawing circles on a chart

2010-11-02 Thread Santosh Srinivas
- rownames(tData) tData.m <- melt(tData) # need to find a way to adjust the color for -ve values balloonplot(tData.m$Period,tData.m$variable,abs(tData.m$value)) -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 03 November 2010 07:51 To: Santosh Srinivas

[R] Drawing circles on a chart

2010-11-02 Thread Santosh Srinivas
Dear Group, I have the following data matrix which is a timeseries. > dput(tData) structure(list(A = c(0.2, 0.13, 0.05, 0.1, 0.02, 0.18, 0.09, 0.06, 0.13), B = c(0.15, 0.06, 0.09, 0.02, 0.03, 0.12, 0.01, 0.15, 0.06), C = c(-0.1, 0, -0.07, -0.06, -0.05, -0.05, -0.06, -0.08, -0.07), D = c(-0.15,

Re: [R] Setting the names of a data.frame

2010-11-02 Thread Santosh Srinivas
ly a readHTMLtable from a webpage. Your solutions works well enough for my purpose ... thanks. -Original Message- From: Ivan Calandra [mailto:ivan.calan...@uni-hamburg.de] Sent: 02 November 2010 22:15 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Setting the names of a data.frame

Re: [R] Setting the names of a data.frame

2010-11-02 Thread Santosh Srinivas
:length(sHeaders)){ names(tData)[i] <- as.character(sHeaders[1,i]) } Or with lapply: names(tData) <- unlist(lapply(sHeaders[1, ], FUN=as.character)) HTH, Ivan Le 11/2/2010 14:58, Santosh Srinivas a écrit : > I have tData as below. I need to set the names with the headers from the >

[R] Setting the names of a data.frame

2010-11-02 Thread Santosh Srinivas
I have tData as below. I need to set the names with the headers from the first row in sHeaders Sorry .. forgot how to set the names from row in another data frame .. pls advise. names(tData) = sHeaders[1,] does not work correctly Also, why doesn't drop.levels(sHeaders) not work? dput(tData) str

Re: [R] how to compare two datasets in R>?

2010-11-01 Thread Santosh Srinivas
Take a look at ?merge for doing such join operations. (I believe that should help) If you had provided a sample of your datasets using dput, I would have checked that for you. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of song song

[R] Using R for Production - Discussion

2010-11-01 Thread Santosh Srinivas
Hello Group, This is an open-ended question. Quite fascinated by the things I can do and the control I have on my activities since I started using R. I basically have been using this for analytical related work off my desktop. My experience has been quite good and most issues where I need to inve

Re: [R] File Downloading Problem

2010-11-01 Thread Santosh Srinivas
voiding writing it to disk and then reading it back in, e.g. library(Rcompression) z = zipArchive(o) names(z) read.csv(textConnection(z[[1]])) D. On 11/1/10 8:27 AM, Santosh Srinivas wrote: > It's strange and the internet connection is fine because I am able to get > data

Re: [R] File Downloading Problem

2010-11-01 Thread Santosh Srinivas
, e.g. library(Rcompression) z = zipArchive(o) names(z) read.csv(textConnection(z[[1]])) D. On 11/1/10 8:27 AM, Santosh Srinivas wrote: > It's strange and the internet connection is fine because I am able to get > data from yahoo. > This was working till just yest

Re: [R] File Downloading Problem

2010-11-01 Thread Santosh Srinivas
Sent: 01 November 2010 20:48 To: Duncan Murdoch Cc: Santosh Srinivas; 'Rhelp' Subject: Re: [R] File Downloading Problem On Nov 1, 2010, at 10:41 AM, Duncan Murdoch wrote: > On 01/11/2010 10:37 AM, Santosh Srinivas wrote: >> Nope Duncan ... no changes .. the same old way without a

Re: [R] File Downloading Problem

2010-11-01 Thread Santosh Srinivas
V2010bha v.csv.zip" download.file(sURL,"test.zip") Put the same URL in a browser and it works fine. -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 01 November 2010 19:04 To: Santosh Srinivas Cc: 'Rhelp' Subject: Re: [R] File Download

Re: [R] write.csv changes the format of the date

2010-11-01 Thread Santosh Srinivas
Hi David, Its strange ... when I run this separately it works ... but I when I do in my function it changes the format. I just opened it using Notepad. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: 01 November 2010 19:15 To: Santosh Srinivas Cc: '

[R] File Downloading Problem

2010-11-01 Thread Santosh Srinivas
Dear Group, My code stopped working ... used to work till last week! sURL <- "http://www.nseindia.com/content/historical/EQUITIES/2010/NOV/cm01NOV2010bha v.csv.zip" > download.file(sURL,"test.zip") trying URL 'http://www.nseindia.com/content/historical/EQUITIES/2010/NOV/cm01NOV2010bha v.csv.zip'

[R] write.csv changes the format of the date

2010-11-01 Thread Santosh Srinivas
Dear Group, Why does write.csv modify the date format when it write to a file. I have the following variable Param_Dat: dput(Param_Dat) structure(list(Last_Successful_Run = structure(1L, .Label = "30/10/2010", class = "factor")), .Names = "Last_Successful_Run", class = "data.frame", row.names =

[R] Downloading Package Sources

2010-10-31 Thread Santosh Srinivas
Dear Group, any idea how I can download the source code for all packages in Windows 7? __ 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 prov

Re: [R] transforming a dataset for association analysis

2010-10-30 Thread Santosh Srinivas
A more usable problem input would definitely help ... use dput to send a reproducible sample to the group Think the below should solve your problem > read.csv("Book1.csv") Subject Item Score 1 Subject 1 Item 1 1 2 Subject 1 Item 2 0 3 Subject 1 Item 3 1 4 Subject 2 Item 1 1

[R] R and Matlab

2010-10-28 Thread Santosh Srinivas
Dear Group, I am looking for ways to use R and Matlab. Doing the data transformations in R and using the data in Matlab to analyze with some pre-defined scripts. Any good ways to transfer the data into matlab in its most recent version? I tried using R.matlab but the writeMat output is not readabl

[R] Best IDE for R

2010-10-27 Thread Santosh Srinivas
Dear R-Group, I am looking for suggestions for the "best" IDE for R. Best is obviously subjective but I need just the basic features that should function well (and I looked through the threads already). - Proper integration with R 2.11.1 - Good key shortcuts ... similar to the R Gui - Manageabilit

[R] Extract table from a webpage

2010-10-25 Thread Santosh Srinivas
Dear R-group, I've been able to use the XML package for getting relevant tables from webpages for my analysis. I'm stuck with this slightly more interactive problem involving clicking a link Fro this link . http://www.etintelligence.com/etig/et500/et500Ranking.jsp I want to get the data tabl

[R] dbWriteTable

2010-10-22 Thread Santosh Srinivas
I'm having a strange problem with dbWriteTable ... I have the dbWriteTable inside a batchloop. dbWriteTable(con,"mutual_funds",tmp_MF_Data_F,append=T,row.names=F) # append rows to the data table The data gets updated for the first 3 loops (out of say 100) but then there is no error a

[R] If Statement with more than one condition

2010-10-22 Thread Santosh Srinivas
I'm unable to find the OR operator like other language .. any suggestions? I want to do If (condition1 OR condition 2){ do something } Thanks for answering this elementary question. [[alternative HTML version deleted]] __ R-help@r-proj

[R] help -> RE: Download.file problem

2010-10-18 Thread Santosh Srinivas
Dear R-helpers ... any thoughts on the below issue ... will help me complete a small project! Strange problem with download.file . for non existent URL an empty file is created but I am not able to delete the without shutting down R Example: > download.file("http://test.com/test.txt","test.txt"

[R] Download.file problem

2010-10-18 Thread Santosh Srinivas
Strange problem with download.file . for non existent URL an empty file is created but I am not able to delete the without shutting down R Example: > download.file("http://test.com/test.txt","test.txt";) trying URL 'http://test.com/test.txt' Error in download.file("http://test.com/test.txt";, "t

Re: [R] read.zoo issues

2010-10-18 Thread Santosh Srinivas
Okay ... now I gotcha ... Thanks -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 18 October 2010 17:19 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] read.zoo issues On Mon, Oct 18, 2010 at 4:24 AM, Santosh Srinivas wrote: > I

Re: [R] Directive for first and last array arguments

2010-10-18 Thread Santosh Srinivas
X[1,1] .. first x[NROW(x),NCOL(x)] for last element and so on Is this what you need? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: 18 October 2010 15:59 To: Rhelp Subject: [R] Directive for first and last array ar

[R] read.zoo issues

2010-10-18 Thread Santosh Srinivas
I am getting problems using read.zoo I have the following data frame > head(anlyNiftyDat[,1:10]) TIMESTAMPACC AMBUJACEM AXISBANK BAJAJ-AUTO BHARTIARTL BHEL BPCL CAIRN CIPLA 1 2010-01-04 00:00:00 913.60106.10 992.101732.05 325.20 2426.10 650.75 285.50 337.55 2 201

Re: [R] Basic structure operations doubt

2010-10-17 Thread Santosh Srinivas
Wiley [mailto:jwiley.ps...@gmail.com] Sent: 18 October 2010 07:47 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Basic structure operations doubt Hi, The easiest way to get rid of the empty levels is with droplevels(). See ?droplevels for details. It actually has a method for data frames

Re: [R] Class mode text isopen can read can write - too many open connections

2010-10-17 Thread Santosh Srinivas
print(paste("Failed to download:", paste("CM",sDate1,".zip",sep="")),file = "Failure-Log.txt",append=TRUE,sep="\n") write(paste("Failed to download:", paste("CM",sDate1,".zip",sep="&qu

[R] Basic structure operations doubt

2010-10-17 Thread Santosh Srinivas
I'm doing these manipulations on the data frame and wondering why does R have to remember historical data on my operation and not just keep the needed info. Probably a basic fundamentals of the way R handles data .. Pls point me to the manual if possible .. I have this Index data: > head(NIFTY_IND

  1   2   >