[R] Accessing Havers data from R?

2011-06-08 Thread Shubha Vishwanath Karanth
Hi R, Do we have R package to extract data from Havers data provider? For example, just like we have RBloomberg package to extract data from Bloomberg. If not are there any other mechanisms to extract the data from Havers? Thanks and Regards, Shubha. This e-mail may contain confid

[R] Dates when transferred from RExcel to R.

2011-01-18 Thread Shubha Vishwanath Karanth
Hi R, The dates when exported from Excel to R by "Put R Var", gives one less day. For example, 1.Let 1/1/2011 be the cell A1 in date format. 2.Right click and select "Put R Var" and give a name to it say, "StartDate" (R in foreground process) 3.In the R console see the value

Re: [R] KMedians clustering in R

2010-09-16 Thread Shubha Vishwanath Karanth
dataset; a median is the mathematical median calculated separately for each dimension.)" Any package which does KMedian clustering algorthm? Many Thanks.   Regards, Shubha. -Original Message- From: Christian Hennig [mailto:chr...@stats.ucl.ac.uk] Sent: Thursday, September 16, 2010 9:32 PM

[R] KMedians clustering in R

2010-09-16 Thread Shubha Vishwanath Karanth
Hi R, Is there a package in R to perform KMedian clustering? Thanks. Shubha This e-mail may contain confidential and/or privileged i...{{dropped:10}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Robust Regression + Stepwise

2010-08-15 Thread Shubha Vishwanath Karanth
Hi R, Can I perform a stepwise method for robust regression? In other words, how do I combine the methods "step" and "rlm" together? Thanks and Regards, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R

[R] Stepwise Regression + entry/exit significance level

2010-08-14 Thread Shubha Vishwanath Karanth
Hi R, Does the "step" function used to perform stepwise regression has the option to specify the entry/exit significance levels for the independent variables? (This is similar to the 'slentry' and 'slstay' option in 'Proc reg' of SAS.). Or do we have any other package which does the above? Than

[R] Maximum seasonal 'q' parameter

2010-08-04 Thread Shubha Vishwanath Karanth
Hi R, Seems like the maximum seasonal 'q' parameter for the ?arima is 350. Any way, where we can increase this? Since I am working on 3 year (q=252*3) and 5 year(q=252*5) returns, I may require this option. Thanks. > fit=arima(r,c(3,0,0),seasonal = list(order = c(0, 0, 500), period = NA));

[R] as.dendrogram for DICE coefficient.

2010-07-27 Thread Shubha Vishwanath Karanth
Hi R, I was using 'as.dendrogram' with the DIST coefficient, where the smaller values of the DIST coefficient, say that the objects are closer to each other, while the larger values of the coefficient say that the objects are far from each other. But now, I have my coefficient as the DICE c

[R] Transformation of Y changes the 'lm' object?

2010-07-20 Thread Shubha Vishwanath Karanth
Hi R, This is a problem, which I have tried to present in a simple way: Let, x1=1:10 x2=2:11 y=2+3*x1 lm_obj=lm(y~x1+x2) lm_obj step(lm_obj) # Step function for the first time y=y^0.1 lm_obj step(lm_obj) #Step function after a transformation on Y, but 'lm_obj' is not modi

Re: [R] Extreme Value Regression model

2010-07-15 Thread Shubha Vishwanath Karanth
h.com   -Original Message- From: Richardson, Patrick [mailto:patrick.richard...@vai.org] Sent: Thursday, July 15, 2010 5:56 PM To: Shubha Vishwanath Karanth; r-help@r-project.org; r-h...@stat.math.ethz.ch Subject: RE: Extreme Value Regression model Well, RSiteSearch("extreme value regression) turns

[R] Extreme Value Regression model

2010-07-14 Thread Shubha Vishwanath Karanth
Hi R, Just like a Poisson regression model, is there a package in R to do Extreme Value Regression model? Thanks. Thanks and Regards, Shubha Karanth This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-pro

[R] R user interface

2010-06-17 Thread Shubha Vishwanath Karanth
Hi R, I have a an excel file with a lot of data. I need to create an user interface in R, which has one single screen. It needs to contain a right pane containing the click buttons for different countries (say). If the user clicks a country, then a chart needs to be created for that country, ta

[R] fgev + negative location parameter for positive data?

2010-06-15 Thread Shubha Vishwanath Karanth
Hi R, I have a vector with all positive values and have fit the GEV distribution (shape parameter=0) to the data and I get the negative value of the location parameter. Is this possible? library(evd) r=read.table("clipboard",header=F)[,1] > length(r) [1] 2087 > sum(r>=0) #All data point

[R] F-statistic in ARIMA model

2010-05-12 Thread Shubha Vishwanath Karanth
Hi all, Can I get the F-statistic from the arima() option? Or at least the residual degrees of freedom in the arima()? Or do I have to convert the ARIMA model back to the regression model and then get the F-statistic? Thanks. Thanks, Shubha This e-mail may contain confidential and/or p

[R] Creating R exe files

2010-05-11 Thread Shubha Vishwanath Karanth
Hi all, Just like Fortran creates EXE files for a code, can R also do the same? Thanks for the info. Thanks and Regards, Shubha Karanth | Amba Research Ph +91 80 3980 8283 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com

Re: [R] DICE Coefficient of similarity measure

2010-04-24 Thread Shubha Vishwanath Karanth
Just wrote a small piece of code to do so. Thanks. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shubha Vishwanath Karanth Sent: Saturday, April 24, 2010 6:28 PM To: r-help@r-project.org; r-h...@stat.math.ethz.ch Cc: gabor.csa

[R] table command

2010-04-24 Thread Shubha Vishwanath Karanth
Hi, Let s be a dataframe. > s A B C 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 > tab1=table(s[,c(1,2)]) > tab1 B A 0 1 0 3 3 1 3 0 > tab2=table(s[,c(1,3)]) > tab2 C A 1 0 6 1 3 The problem is I ne

[R] DICE Coefficient of similarity measure

2010-04-24 Thread Shubha Vishwanath Karanth
Hi, I wanted the DICE coefficient (similarity measure for binary variables) to be calculated in R and found that the "igraph" package has the option of "similarity.dice" to do this. But, for this command, the input object should be an igraph object. But, I have a dataframe of columns containing

[R] Time series cross-sectional regression analysis

2010-02-21 Thread Shubha Vishwanath Karanth
Hi all, Is there a package in R to perform time series cross-sectional regression analysis (like the TSCSREG procedure in SAS)? Thanks for the info. Thanks and Regards, Shubha Karanth | Amba Research Ph +91 80 3980 8283 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * Sa

Re: [R] Scores in Dimensions in Correspondence Analysis

2010-01-03 Thread Shubha Vishwanath Karanth
] On Behalf Of Shubha Vishwanath Karanth Sent: Sunday, January 03, 2010 6:30 PM To: r-help@r-project.org Subject: Re: [R] Scores in Dimensions in Correspondence Analysis Does the $rowcoord and $colcoord help? Thanks and Regards, Shubha Karanth -Original Message- From: r-help-boun...@r

Re: [R] Scores in Dimensions in Correspondence Analysis

2010-01-03 Thread Shubha Vishwanath Karanth
Does the $rowcoord and $colcoord help? Thanks and Regards, Shubha Karanth -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shubha Vishwanath Karanth Sent: Sunday, January 03, 2010 6:25 PM To: r-help@r-project.org Subject: [R

[R] Scores in Dimensions in Correspondence Analysis

2010-01-03 Thread Shubha Vishwanath Karanth
Hi R, I was experimenting with the CA package for correspondence analysis. data(author) ca(author) plot(ca(author)) How can I get the values used by the plot for the two axis for biplot? In other words, how will I be able to obtain the scores in the dimensions (which are obtained b

[R] Digitizing the Plot

2009-04-16 Thread Shubha Vishwanath Karanth
Hi R, Wanted to check if there are any packages available for getting the (x,y) data points of a graph or a plot, which is in the image format. Say, the plot could be a published report, and I want to get the points of the curve plotted. (I am speaking something related the subject discussed in

[R] Built-in Code behind SVM

2009-04-09 Thread Shubha Vishwanath Karanth
Hi R, I need to see the inner code behind the function "svm" in the package e1071. I enter svm in the console and get the below output. > svm function (x, ...) UseMethod("svm") Is there any way I can look into the code of what svm (support vector machine) is doing? Thanks a lo

Re: [R] Have a function like the "_n_" in R ? (Automatic count function)

2009-02-25 Thread Shubha Vishwanath Karanth
> temp=data.frame(a=c(4,3,2,6),b=c(7,4,2,4)) > temp a b 1 4 7 2 3 4 3 2 2 4 6 4 > temp$counter=1:nrow(temp) > temp a b counter 1 4 7 1 2 3 4 2 3 2 2 3 4 6 4 4 Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New Yo

Re: [R] Calling R from SAS

2009-01-24 Thread Shubha Vishwanath Karanth
-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shubha Vishwanath Karanth Sent: Saturday, January 24, 2009 6:58 PM To: r-h...@stat.math.ethz.ch Subject: [R] Calling R from SAS Can I call R from SAS? I tried the below command in SAS, but not working... OPTIONS

[R] Calling R from SAS

2009-01-24 Thread Shubha Vishwanath Karanth
Can I call R from SAS? I tried the below command in SAS, but not working... OPTIONS XWAIT XSYNC; X "C:\Program Files\R\R-2.7.1\bin\R.exe --no-save -quiet <""C:\TEMPO\program.r""> ""C:\TEMPO\program.log"""; Had done this before and it was working perfect... But now, not... Sorry if thi

Re: [R] Downloading Reuters data from R

2008-12-12 Thread Shubha Vishwanath Karanth
. Mine is a Windows XP Config. Thanks again, Shubha -Original Message- From: rory.wins...@rbs.com [mailto:rory.wins...@rbs.com] Sent: Thursday, December 11, 2008 9:44 PM To: Shubha Vishwanath Karanth; r-h...@stat.math.ethz.ch Subject: RE: Downloading Reuters data from R Hi Shubha I have c

[R] Downloading Reuters data from R

2008-12-11 Thread Shubha Vishwanath Karanth
Hi R, Can we download Reuters (3000 Xtra) data from R? Does ODBC package help me in this? Or otherwise, is there a way to extract daily closing prices data of Reuters from R? Thank you very much, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}}

[R] Mismatch in logical result?

2008-11-07 Thread Shubha Vishwanath Karanth
Hi R, I have certain checkings, which gives FALSE, but actually it is true. Why does this happen? Note that the equations that I am checking below are not even the case of recurring decimals... > 1.4^2 == 1.96 [1] FALSE > 1.2^3==1.728 [1] FALSE Thanks in advance, Shubha S

[R] Row and Column positions

2008-10-31 Thread Shubha Vishwanath Karanth
Hi R, m=data.frame(a=c(1,NA,5,5),b=c(4,5,6,7),c=c(NA,NA,NA,5)) I want to know the methods of getting row and column positions of NA in the above dataframe. How do I do this? Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}}

Re: [R] SAS Data

2008-10-13 Thread Shubha Vishwanath Karanth
library(foreign) Rdata=read.ssd("Z:/MyFolder","data1",sascmd = "C:/Program Files/SAS/SAS 9.1/sas.exe") Rdata Y D1 D2 D3 1 100 1 0 0 2 101 1 0 0 3 105 1 0 0 4 200 0 1 0 5 201 0 1 0 6 205 0 1 0 7 300 0 0 1 8 301 0 0 1 9 305 0 0 1 where 'data1' is the SAS datafile to

[R] Cross-tabulation Question

2008-09-29 Thread Shubha Vishwanath Karanth
Hi R, This is a cross tabulation question. Suppose that, > d=read.table("clipboard",header=F) > d V1 V2V3 A One Apple A One Cake A One Cake B One Apple B One Apple B One Apple > table(d$V2,d$V3) Apple Cake One 42 Bu

[R] To find vector X under contraints

2008-09-08 Thread Shubha Vishwanath Karanth
Hi R, I have the variance-covariance matrix, >V=matrix(c(0.09238, 0.002407527, 0.002407527, 0.020739401),2,2) I need to find a vector X=c(x1,x2), such that 1) X'VX is equal to a constant 2 (say) and 2) sum(x) should be equal to a another constant 1.5 (say). How do we do this

Re: [R] extracting max row from data matrix

2008-09-08 Thread Shubha Vishwanath Karanth
> aggregate(x$weight,list(x$fruit),max) Group.1 x 1 apple 1.6 2 orange 1.6 Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED]

Re: [R] Between the values

2008-08-12 Thread Shubha Vishwanath Karanth
t 12, 2008 7:21 PM To: r-help@r-project.org Subject: Re: [R] Between the values Shubha Vishwanath Karanth wrote: > > Or at least anyways of defining a vector/(or something like that) which > has all values between 0 and 1? > > For example: > C(0,1) is incorrect, seq(0,1

Re: [R] Between the values

2008-08-12 Thread Shubha Vishwanath Karanth
gust 12, 2008 7:34 PM To: Shubha Vishwanath Karanth; 'Dan Davison' Cc: [EMAIL PROTECTED] Subject: RE: [R] Between the values Here is how you check whether a < x < b "without" using the `&' condition: is.between <- function(x, a, b) { (x - a) * (b - x) > 0 }

Re: [R] Between the values

2008-08-12 Thread Shubha Vishwanath Karanth
anth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Ravi Varadhan [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2008 7:12 PM To: Shubha Vishwanath Karanth;

Re: [R] Between the values

2008-08-12 Thread Shubha Vishwanath Karanth
Davison [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2008 5:54 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] Between the values On Tue, Aug 12, 2008 at 05:16:01PM +0530, Shubha Vishwanath Karanth wrote: > Hi R, > > > > This is a very trivial one...

[R] Between the values

2008-08-12 Thread Shubha Vishwanath Karanth
Hi R, This is a very trivial one C=0.1 I want to check whether my value of C is between 0 and 1 exclusively I don't want to use (C>0 & C<1). And I can't use a single statement like (0https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

Re: [R] Downloading Yahoo data

2008-08-07 Thread Shubha Vishwanath Karanth
Dallazuanna [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2008 8:17 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] Downloading Yahoo data You are connecting to the internet trougth a proxy? On Thu, Aug 7, 2008 at 9:40 AM, Shubha Vishwanath Karanth <[EMAIL PROTEC

[R] Downloading Yahoo data

2008-08-07 Thread Shubha Vishwanath Karanth
Hi R, I am trying to download the data from R. I give the below command. > library(fImport) > yahooSeries("IBM") trying URL 'http://chart.yahoo.com/table.csv?s=IBM&a=7&b=08&c=2007&d=7&e=07&f=2008&; g=d&x=.csv' Error in download.file(url = url, destfile = file, method = method) : cann

[R] "dens" function

2008-07-30 Thread Shubha Vishwanath Karanth
Hi R, Is there a function called "dens" in R? Is it similar to density? I found this function in an RExcel demo... Or is it in a specific other package? The function is used as (=rapply("dens",A11:A1010,100,D8,-5,5)) Thanks, Shubha This e-mail may contain confidential and/or privile

Re: [R] sequential sum of a vector...

2008-07-23 Thread Shubha Vishwanath Karanth
eying... Thanks, shubha From: Jorge Ivan Velez [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2008 8:59 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] sequential sum of a vector... Dear Shubha, Try this: x=1:80 tapply(x,rep

[R] sequential sum of a vector...

2008-07-23 Thread Shubha Vishwanath Karanth
Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: aggregate(x,list(rep(1:10,each=8)),sum)[-1] or rowsum(x,group=r

Re: [R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
OK, Let x=c(4,2,2) y=c(1,5,3) My result should be c(4,1,2,5,2,3) Thanks, Shubha -Original Message- From: Doran, Harold [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2008 6:47 PM To: Shubha Vishwanath Karanth; [EMAIL PROTECTED] Subject: RE: [R] Simple... but... x <-

Re: [R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
Guess this should be fine c(rbind(x,y)) Please let me know if there are some better ways... Thanks, Shubha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 6:25 PM To: [EMAIL PROTECTED

[R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-proje

[R] A neural network problem---neuralnet package

2008-07-18 Thread Shubha Vishwanath Karanth
Hi R, Here's a question/problem on the 'neuralnet' package for neural networks. I have more than 50 factors in each of my independent variables. When I apply the command 'neuralnet', I get the below warning message, > net.sum <- neuralnet( Sum~Var1+Var2+Var3, b, hidden=0,linear.output=TRUE

Re: [R] Sum(Random Numbers)=100

2008-07-07 Thread Shubha Vishwanath Karanth
- From: Moshe Olshansky [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 12:09 PM To: [EMAIL PROTECTED]; Shubha Vishwanath Karanth Subject: Re: [R] Sum(Random Numbers)=100 If they are really random you can not expect their sum to be 100. However, it is not difficult to get that given that

[R] Sum(Random Numbers)=100

2008-07-07 Thread Shubha Vishwanath Karanth
Hi R, I need to generate 50 random numbers (preferably poisson), such that their sum is equal to 100. How do I do this? Thank you, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-project.org ma

[R] Comparison between R and MATLAB

2008-06-19 Thread Shubha Vishwanath Karanth
Hi R, Can I get a comparison between R and MATLAB? How is R efficient than MATLAB? Or what are the weaknesses of R compared to MATLAB? Thank you very much for your help, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London *

[R] Calling R functions into C# or C++

2008-06-19 Thread Shubha Vishwanath Karanth
Hi R, I have a request... Can I call R functions/routines from C# or C++? If so, how do I do this? Do I need to have some knowledge on DLL to do this? Thanks a lot for your help, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colomb

[R] The log function problem

2008-06-11 Thread Shubha Vishwanath Karanth
Hi R, Please see the below commands. The question is I can see the value of log(2) before loading the package fcalendar in R. But after loading the package, the 'log' function doesn't work. How to solve this problem? Also note that the function code differs before and after downloading the pack

[R] Polynomial Goal Programming

2008-06-10 Thread Shubha Vishwanath Karanth
Hello R, Is there a package to perform Polynomial goal programming in R? BR, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com This e-mail may contain confidential a

Re: [R] Overlaying the matrices

2008-06-09 Thread Shubha Vishwanath Karanth
ix 'xx' should contain only the corresponding elements in x, rest all should be NA. Any ideas for this? Thanks, Shubha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Monday, June 09, 2008 4:57 PM To: [EMAIL PROTEC

[R] Overlaying the matrices

2008-06-09 Thread Shubha Vishwanath Karanth
Hi R, I have a matrix, > x1=matrix(NA,6,6,dimnames=list(letters[1:6],LETTERS[1:6])) > x1 A B C D E F a NA NA NA NA NA NA b NA NA NA NA NA NA c NA NA NA NA NA NA d NA NA NA NA NA NA e NA NA NA NA NA NA f NA NA NA NA NA NA > x2=matrix(rpois(9,1),3,3,dimnames=list(c("b","a"

Re: [R] sum of unknown number of matrices

2008-06-04 Thread Shubha Vishwanath Karanth
[mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2008 8:49 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] sum of unknown number of matrices Shubha Vishwanath Karanth wrote: > I need: > >> a+b+c+d > > [,1] [,2] > > [1,]4

[R] sum of unknown number of matrices

2008-06-04 Thread Shubha Vishwanath Karanth
Hi R, I have a list of matrices. I need to get the sum of all the matrices in the list. Example: a=b=c=d=matrix(1:4,2,2) l=list(a,b,c,d) I need: > a+b+c+d [,1] [,2] [1,]4 12 [2,]8 16 Something like do.call("+",l) is not working...why is this? I may n

Re: [R] Solving 100th order equation

2008-05-24 Thread Shubha Vishwanath Karanth
[mailto:[EMAIL PROTECTED] Sent: Saturday, May 24, 2008 6:13 PM To: Peter Dalgaard Cc: Shubha Vishwanath Karanth; [EMAIL PROTECTED]; Duncan Murdoch Subject: Re: [R] Solving 100th order equation On Sat, May 24, 2008 at 8:31 AM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Shubha Vishwanat

Re: [R] Solving 100th order equation

2008-05-24 Thread Shubha Vishwanath Karanth
To apply uniroot I don't even know the interval values... Does numerical methods help me? Or any other method? Thanks and Regards, Shubha -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: Saturday, May 24, 2008 5:08 PM To: Shubha Vishwanath Karanth Subject: R

[R] Solving 100th order equation

2008-05-24 Thread Shubha Vishwanath Karanth
Hi R, I have a 100th order equation for which I need to solve the value for x. Is there a package to do this? For example my equation is: (x^100 )- (2*x^99) +(10*x^50)+.. +(6*x ) = 4000 I have only one unknown value and that is x. How do I solve for this? BR,

Re: [R] Pros and Cons of R

2008-05-22 Thread Shubha Vishwanath Karanth
Completely agreed! BR, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ruben Roa Ureta

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
By RD library I mean the xport library... Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Shubha Vishwanath Karanth Sent: Thursday, May 15, 2008 7

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
letters/characters exceeded 8, those were not read! Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
: Shubha Vishwanath Karanth Sent: Thursday, May 15, 2008 7:03 PM To: Peter Dalgaard Cc: [EMAIL PROTECTED] Subject: RE: [R] Reading SAS data into R Hi Peter, Realized that the log files are generated only when there is an error. Here are my contents of the log file: libname src2rd 'Z:

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
0 ; Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Thursda

Re: [R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
[mailto:[EMAIL PROTECTED] Sent: Thursday, May 15, 2008 6:30 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] Reading SAS data into R Shubha Vishwanath Karanth wrote: > Hi R, > > > > Suppose that SAS dataset 'tsubset1' is stored in the path, "Z:/

[R] Reading SAS data into R

2008-05-15 Thread Shubha Vishwanath Karanth
Hi R, Suppose that SAS dataset 'tsubset1' is stored in the path, "Z:/data". Then I give the below read.ssd() command to read SAS dataset, 'tsubset1.sas7bat' into R. > library(foreign) > s=read.ssd("Z:/data","tsubset1",sascmd = "C:/Program Files/SAS/SAS 9.1/sas.exe") > s A B C 1 3 4 5

[R] apply function

2008-05-14 Thread Shubha Vishwanath Karanth
Hi R, Getting a strange result using ?apply. Please look into the below codes: > d=data.frame(a=c(1,2,3),b=c("A","B","C"),c=c(TRUE,FALSE,FALSE),d=c(T,F,F )) > class(d[,1]) [1] "numeric" > class(d[,2]) [1] "factor" > class(d[,3]) [1] "logical" > class(d[,4]) [1] "logical" > ap

[R] A very simple question

2008-05-14 Thread Shubha Vishwanath Karanth
Hi R, Suppose l=c(1,1,1,2,2,1,1,1) k[-which(k==1)] [1] 2 2 k[-which(k==2)] [1] 1 1 1 1 1 1 But, k[-which(k==3)] numeric(0) I do not want this numeric(0), instead the whole k itself should be my result... How do I do this? Thanks, Shubha This e-mail may contai

Re: [R] dataframes to a list

2008-05-14 Thread Shubha Vishwanath Karanth
rom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, May 14, 2008 3:59 PM To: [EMAIL PROTECTED] Subject: [R] dataframes to a list Hi R, I have the data frames, data1, data2data50. Now I want to put all of these in a single lis

[R] dataframes to a list

2008-05-14 Thread Shubha Vishwanath Karanth
Hi R, I have the data frames, data1, data2data50. Now I want to put all of these in a single list. But, >list(data1, data2,.data50) is very big to write. How do I then do it? Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __

[R] Remove an object by the reference

2008-05-13 Thread Shubha Vishwanath Karanth
Hi R, A simple question, but don't know the answer... x="a" a=5 I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible? Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New Y

[R] Regular Expressions

2008-05-13 Thread Shubha Vishwanath Karanth
Hi R, Again struck with regular expressions... Suppose, S=c("World_is_beautiful", "one_two_three_four","My_book") I need to extract the last but one element of the strings. So, my output should look like: Ans=c("is","three","My") gsub() can do this...but wondering how do I giv

Re: [R] Quadratic Constraints

2008-05-12 Thread Shubha Vishwanath Karanth
Hello R, By any chance, Rdonlp2 package of R defined in http://arumat.net/Rdonlp2/tutorial.html#SECTION0002 serves the below purpose? BR, Shubha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Monday, May

[R] Quadratic Constraints

2008-05-12 Thread Shubha Vishwanath Karanth
Hi R, A quick question How can I optimize the objective function constrained to quadratic constraints? Which function of R is useful for quadratic constraints? Many Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} ___

Re: [R] Re turning variable names with variables (in a function)

2008-05-08 Thread Shubha Vishwanath Karanth
You can just go for a small change in the function as, results <- cbind(se, upper, lower, cv) OR results <- data.frame(se, upper, lower, cv) -S- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stropharia Sent: Thursday, May 08, 2008 5:51 PM To: r-help@r-p

[R] orders of the arima model

2008-05-08 Thread Shubha Vishwanath Karanth
Hi R, Was just checking the "?ar ", the autoregressive model. It's great that R can give the order of the autoregressive model. Suppose if I had 2000 observations to fit an AR model. Then, if I am correct R builds 33+1 autoregressive models (10*log10(2000)=33) and select the order at which the

Re: [R] To preserve the class "Matrix"

2008-05-06 Thread Shubha Vishwanath Karanth
- From: Shubha Vishwanath Karanth Sent: Tuesday, May 06, 2008 8:50 PM To: 'Mark Leeds' Subject: RE: [R] To preserve the class "Matrix" Thank you very much Mark! That worked Just a question, ?[ does give an error to me...how do I find it? Shubha Karanth | Amba Research

[R] To preserve the class "Matrix"

2008-05-06 Thread Shubha Vishwanath Karanth
Hi, Suppose a=matrix(1:9,3,3) > a [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 Now, > class(a[1:2,]) [1] "matrix" > class(a[1:3,]) [1] "matrix" > class(a[,1:2]) [1] "matrix" > class(a[,1:3]) [1] "matrix" But, > class(a[1,]) [1] "i

Re: [R] single plot statement, multiple plots

2008-05-06 Thread Shubha Vishwanath Karanth
, multiple plots "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi R, > > par(mfrow=c(2,2)) > > x1=(1:5)^1; x2=(1:5)^2; x3=(1:5)^3; x4=(1:5)^4 > > I need to write a single plot statement, which creates 4 plots (for >

Re: [R] single plot statement, multiple plots

2008-05-06 Thread Shubha Vishwanath Karanth
: Tuesday, May 06, 2008 7:40 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] single plot statement, multiple plots Try plot.zoo in which case you don't need the par: library(zoo) plot(zoo(cbind(x1, x2, x3, x4)), nc = 2) or plot(zoo(outer(1:5, 1:4, "^")

[R] single plot statement, multiple plots

2008-05-06 Thread Shubha Vishwanath Karanth
Hi R, par(mfrow=c(2,2)) x1=(1:5)^1; x2=(1:5)^2; x3=(1:5)^3; x4=(1:5)^4 I need to write a single plot statement, which creates 4 plots (for x1, x2, x3 and x4) in the graphics window, without using 'for' loop. Is this possible? Does 'do.call' help in this context? Or do I have any option in

Re: [R] Number of words in a string

2008-04-09 Thread Shubha Vishwanath Karanth
Number of words in a string On Apr 9, 2008, at 1:27 PM, Hans-Jörg Bibiko wrote: > > On 09.04.2008, at 17:46, Shubha Vishwanath Karanth wrote: >> To put it simple, >> >> C=c("My Dog", "Its really good", "Beautiful") >> >> Now

Re: [R] Number of words in a string

2008-04-09 Thread Shubha Vishwanath Karanth
on * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, April 09, 2008 9:01 PM To: Markus Gesmann; [EMAIL PROTECTED] Subject: Re: [R] Number of words in a st

Re: [R] Number of words in a string

2008-04-09 Thread Shubha Vishwanath Karanth
Got all the answers using ?strsplit... Is there any way without using string split?... More specifically... How can I just extract the last word in all the strings without using ?strsplit ? Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London *

Re: [R] Number of words in a string

2008-04-09 Thread Shubha Vishwanath Karanth
31 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Markus Gesmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 09, 2008 9:00 PM To: Shubha Vishwanath Karanth; [EMAIL PROTECTED] Subject: RE: [R] Nu

Re: [R] Number of words in a string

2008-04-09 Thread Shubha Vishwanath Karanth
ew York * San José * Singapore * www.ambaresearch.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, April 09, 2008 8:51 PM To: [EMAIL PROTECTED] Subject: [R] Number of words in a string Hi R, A quick quest

[R] Number of words in a string

2008-04-09 Thread Shubha Vishwanath Karanth
Hi R, A quick question: How do we find the number of words in a string? Example: C="Have a nice day" And the number of words should be 4. any built in function or?... Thanks, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo *

[R] Mode Vs Class

2008-04-08 Thread Shubha Vishwanath Karanth
Hi R, Just came across the 'mode' of an object. What is the basic difference between ?class and ?mode...For example: d=data.frame(a=c(1,2),b=c(5,6)) class(d) [1] "data.frame" mode(d) [1] "list" But, c=c(2,3,5,6,7) class(c) [1] "numeric" mode(c) [1] "numeric" Could anyone

Re: [R] Dimensions of a List

2008-03-25 Thread Shubha Vishwanath Karanth
* New York * San José * Singapore * www.ambaresearch.com -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2008 9:21 PM To: Shubha Vishwanath Karanth Cc: [EMAIL PROTECTED] Subject: Re: [R] Dimensions of a List Is this what you want? > l=list(lis

[R] Dimensions of a List

2008-03-25 Thread Shubha Vishwanath Karanth
Hi R, I have a list, l=list(list(c(1,2),c(4,5),c(6,7)),list(c(11,22,33),c(44,55,66))) > l [[1]] [[1]][[1]] [1] 1 2 [[1]][[2]] [1] 4 5 [[1]][[3]] [1] 6 7 [[2]] [[2]][[1]] [1] 11 22 33 [[2]][[2]] [1] 44 55 66 How do I know the dimensions of this list?...

[R] extracting p-value from an lrm object

2008-03-10 Thread Shubha Vishwanath Karanth
Hi, How can I extract p-values from an 'lrm' (logistic regression model) oject? Thank you, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] RMysql question

2008-02-27 Thread Shubha Vishwanath Karanth
R users, I have a problem in RMysql. The error I get is: > library(RMySQL) > library(RMySQL) >options(expressions=1) > MySQL(max.con = 16, fetch.default.rec = 500, force.reload = FALSE) Error: protect(): protection stack overflow I have no idea of why the error is. Can anyone he

[R] Transposing by a group variable

2008-02-14 Thread Shubha Vishwanath Karanth
Hi R, Can I transpose a data frame by a particular group variable? For example: d=data.frame(group=c(1,1,2,2,2),val=c(6,4,6,3,5)) And my output should be: data.frame(group=c(1,2),v1=c(6,6),v2=c(4,3),v3=c(NA,5)) Many thanks, Shubha This e-mail may contain confidential and/or privile

Re: [R] .fortran code

2008-02-07 Thread Shubha Vishwanath Karanth
London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Ravi Varadhan [mailto:[EMAIL PROTECTED] Sent: Thursday, February 07, 2008 8:56 PM To: Shubha Vishwanath Karanth; [EMAIL PROTECTED] Subject: RE: [R] .fortran code If you look at the source code for eigen() y

[R] .fortran code

2008-02-07 Thread Shubha Vishwanath Karanth
Hi, I need to look/understand what the ".fortran()" doing in say, the source code of the "eigen" command. How do I look into this? Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-project.o

[R] wilderSum

2008-02-06 Thread Shubha Vishwanath Karanth
Hi, Can somebody tell me the formula for "?wilderSum" in TTR package? I mean how are these calculated? BR, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com This e-

[R] Accessing the elements of a list

2008-02-01 Thread Shubha Vishwanath Karanth
Hi R, I wanted to know how do we access the elements of a list. In particular, v=list(c(1,2,3,4,5),c(1,2,33,4,5),c(1,2,333,4,5),c(1,2,,4,5)) I want to access all the thirds items of the elements of the list. i.e., I want to access the elements, 3,33,333,. This can be done throug

  1   2   >