Re: [R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
Two things I'd try: run your code in a clean R session, started at the command line with R --vanilla and just loading that exact dataset and running that line of code, in case there are issues with other things in your session. Upgrade to the current version of R. Dear Sarah, I upgraded

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
This is probably due to a numerical value that is coded as a factor. Have a look at the example below. In ggplot2 one line per group is plotted. The default grouping is the combination of all factors. In the first example only B, in the second and third example both A and B. This leaves just

[R] searching and replacing in a data frame.

2011-07-15 Thread Ashim Kapoor
Dear R helpers, Please have a look at the following : - Note : My goal is to find and replace all Inf's in a data array with 0. t-data.frame(A=c(Inf,0,0),B=c(1,2,3)) t A B 1 Inf 1 2 0 2 3 0 3 str(t) 'data.frame':3 obs. of 2 variables: $ A: num Inf 0 0 $ B: num 1 2 3

Re: [R] searching and replacing in a data frame.

2011-07-17 Thread Ashim Kapoor
Dear David, Many thanks for your reply. On Fri, Jul 15, 2011 at 5:24 PM, David Winsemius dwinsem...@comcast.netwrote: On Jul 15, 2011, at 5:20 AM, Ashim Kapoor wrote: Dear R helpers, Please have a look at the following : - Note : My goal is to find and replace all Inf's in a data

Re: [R] searching and replacing in a data frame.

2011-07-18 Thread Ashim Kapoor
ttt - data.frame(A = c(Inf, 0, 0), B = c(1, 2, 3)) apply(ttt, 2, function(x) {x[is.infinite(x)] - 0; x}) Ok thank you. That does work. What does apply(ttt, 1, function(x) x[is.infinite(x)] - 0 ) this return. I get all 0's,but can you explai why ? Thank you. Ashim [[alternative

Re: [R] searching and replacing in a data frame.

2011-07-18 Thread Ashim Kapoor
Ok Josh. Many thanks for your effort. Ashim : ) On Mon, Jul 18, 2011 at 1:34 PM, Joshua Wiley jwiley.ps...@gmail.comwrote: On Mon, Jul 18, 2011 at 12:22 AM, Ashim Kapoor ashimkap...@gmail.com wrote: ttt - data.frame(A = c(Inf, 0, 0), B = c(1, 2, 3)) apply(ttt, 2, function(x) {x

[R] Different result on using apply.

2011-07-29 Thread Ashim Kapoor
Dear R-helpers, In the following example I compute ret and returns the SAME way. In ret I use compute returns for EACH column and in returns I do it for the whole data frame. Could someone please tell me why I see a lagged result,by which I mean ret and returns are different by one lag.

Re: [R] Different result on using apply.

2011-07-30 Thread Ashim Kapoor
NA Dennis On Thu, Jul 28, 2011 at 11:09 PM, Ashim Kapoor ashimkap...@gmail.com wrote: Dear R-helpers, In the following example I compute ret and returns the SAME way. In ret I use compute returns for EACH column and in returns I do it for the whole data frame. Could someone please tell

Re: [R] How to extract sublist from a list?

2011-08-04 Thread Ashim Kapoor
Dear All, How would we do this problem looping over seq(1:2) ? Thank you, Ashim On Thu, Aug 4, 2011 at 10:59 AM, Richard Ma xuanlong...@uts.edu.au wrote: Thank you so much GlenB! I got it done using your method. I'm just curious how did you get this idea? Cause for me, this looks so

Re: [R] How to extract sublist from a list?

2011-08-04 Thread Ashim Kapoor
How would we do this problem looping over seq(1:2) ? To extend the example in the corresponding nabble post : - sub1-list(x=a,y=ab) sub2-list(x=c,y=ad) lst-list(sub1=sub1,sub2=sub2) for ( t in seq(1:2) ) print(lst[[t]]$y) So I can print out the sub1$y/sub2$y but it's not clear how to

Re: [R] How to extract sublist from a list?

2011-08-04 Thread Ashim Kapoor
On Thu, Aug 4, 2011 at 1:02 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Thu, Aug 4, 2011 at 12:12 AM, Ashim Kapoor ashimkap...@gmail.com wrote: How would we do this problem looping over seq(1:2) ? Because this goes to an email list serv, it is good practice to quote the original

Re: [R] How to extract sublist from a list?

2011-08-04 Thread Ashim Kapoor
On Thu, Aug 4, 2011 at 2:12 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Thu, Aug 4, 2011 at 1:40 AM, Ashim Kapoor ashimkap...@gmail.com wrote: On Thu, Aug 4, 2011 at 1:02 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Thu, Aug 4, 2011 at 12:12 AM, Ashim Kapoor ashimkap

Re: [R] How to extract sublist from a list?

2011-08-04 Thread Ashim Kapoor
Thank you Joshua. Ashim. On Thu, Aug 4, 2011 at 2:53 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Thu, Aug 4, 2011 at 2:08 AM, Ashim Kapoor ashimkap...@gmail.com wrote: On Thu, Aug 4, 2011 at 2:12 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Thu, Aug 4, 2011 at 1:40 AM

[R] Displaying str(zoo) in Sweave

2011-09-20 Thread Ashim Kapoor
Dear R-helpers, Please look at the following minimal code. \documentclass[a4paper]{article} \begin{document} == library(zoo) a-zoo(1:4,order.by=Sys.time()+1:4) str(a) @ \end{document} When I do R CMD Sweave,followed by pdflatex ,and view the final pdf, the letter surrounding the phrase zoo, a

Re: [R] Displaying str(zoo) in Sweave

2011-09-20 Thread Ashim Kapoor
On Tue, Sep 20, 2011 at 4:31 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 11-09-20 3:08 AM, Ashim Kapoor wrote: Dear R-helpers, Please look at the following minimal code. \documentclass[a4paper]{**article} \begin{document} == library(zoo) a-zoo(1:4,order.by=Sys.time()**+1:4

[R] R CMD build and vignettes

2011-09-21 Thread Ashim Kapoor
Dear R-helpers, www.statistik.lmu.de/~*leisch*/*Sweave*/*Sweave*-Rnews-2003-2.pdf says that R CMD build creates the pdf from a .Rnw file. But when I do R CMD build followed by R CMD check it gives me a warning that there is a vignette without a PDF. My query is : when R CMD build works it

Re: [R] R CMD build and vignettes

2011-09-21 Thread Ashim Kapoor
/**pipermail/r-devel/2011-May/**060775.htmlhttps://stat.ethz.ch/pipermail/r-devel/2011-May/060775.html Regards, Enrico Am 21.09.2011 11:01, schrieb Ashim Kapoor: Dear R-helpers, www.statistik.lmu.de/~*leisch***/*Sweave*/*Sweave*-Rnews-2003-**2.pdfhttp://www.statistik.lmu.de/%7E*leisch*/*Sweave

Re: [R] R CMD build and vignettes

2011-09-21 Thread Ashim Kapoor
the procedure. Thank you Enrico that was very interesting to hear. Regards, Ashim Am 21.09.2011 12:38, schrieb Ashim Kapoor: Dear Enrico, Many thanks for your reply.I was doing R CMD check pkg ( where pkg is the directory name and NOT the tar ball ). May I ask another query or should

[R] Does replacing some values of a zoo object by NA reduce it's size ?

2011-09-27 Thread Ashim Kapoor
Dear R-helpers, Please have a look at the following. f1 is the same as f2 except that it has some values replaced by NA. But it's corresponding file is slightly bigger than the file containing f2. Could someone please tell me if this is an anomaly ? load(file1) ls() [1] f1 load(file2) ls()

[R] Coercing a character zoo to a numeric

2011-09-27 Thread Ashim Kapoor
Dear R-helpers, It seems to me that a character zoo cannot be coerced to a numeric zoo. Below is a minimal example. Can someone tell me what I have done wrong? z-zoo(1:4,order.by=1:4) coredata(z)-as.character(coredata(z)) str(z) ‘zoo’ series from 1 to 4 Data: chr [1:4] 1 2 3 4 Index: int

Re: [R] Coercing a character zoo to a numeric

2011-09-27 Thread Ashim Kapoor
) However, I prefer to use this sort of line of code: z.Num - zoo(as.double(z.Str), index(z.Str)) finding it a little more transparent. Hope this helps, Michael Weylandt On Tue, Sep 27, 2011 at 5:56 AM, Ashim Kapoor ashimkap...@gmail.comwrote: Dear R-helpers, It seems to me that a character

Re: [R] Coercing a character zoo to a numeric

2011-09-27 Thread Ashim Kapoor
) != z Consider this: x = letters[1:5] x2 - x1 - x mode(x) x1[1:5] - 1:5 # Modify the values of x1 without changing the mode print(x1) x2 - 1:5 # Replace x2 print(x2) Michael Weylandt On Tue, Sep 27, 2011 at 6:41 AM, Ashim Kapoor ashimkap...@gmail.comwrote: Dear Michael, I don't

Re: [R] Create order of numbers based on a given vector

2011-10-13 Thread Ashim Kapoor
Apologies,it should be ans-cumsum(vec1) On Thu, Oct 13, 2011 at 4:58 PM, Ashim Kapoor ashimkap...@gmail.com wrote: I don't have access to R so I can't test my example but I think this will work. vec ( as defined by you) # flip the false and the trues vec1-ifelse(vec==FALSE,TRUE,FALSE

Re: [R] Create order of numbers based on a given vector

2011-10-13 Thread Ashim Kapoor
I don't have access to R so I can't test my example but I think this will work. vec ( as defined by you) # flip the false and the trues vec1-ifelse(vec==FALSE,TRUE,FALSE) ans-cumsum(vec) Regards, Ashim On Thu, Oct 13, 2011 at 4:45 PM, syrvn ment...@gmx.net wrote: Hello! If I have a vector

[R] splitting by the last occurance of a dot

2011-11-08 Thread Ashim Kapoor
Dear R-helpers, I want to split the following vector into 2 vectors by the last occurance of a . dput(rownames(sensext)) c(pat, cash_bank_bal, invest_abroad, pat.1, cash_bank_bal.1, invest_abroad.1, pat.2, cash_bank_bal.2, invest_abroad.2, pat.3, cash_bank_bal.3, invest_abroad.3, pat.4,

Re: [R] splitting by the last occurance of a dot

2011-11-08 Thread Ashim Kapoor
Assuming we want to split off the number at the end try this which splits on those dots which are followed by a digit: strsplit(r, \\.(?=\\d), perl = TRUE) Dear Gabor, Thank you very much. That works very well. I don't completely understand it though. A few words on what the (?=\\d) is

Re: [R] splitting by the last occurance of a dot

2011-11-08 Thread Ashim Kapoor
See the info on zero width lookahead assertions on the ?regex page. Thank you again. Best Regards, Ashim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Generating the Ctrl-M character

2011-11-10 Thread Ashim Kapoor
Dear R-helpers, I want to append a Ctrl-M character to a string and then save it to a text file. mystring-This is a test. # How do I add a Ctrl-M to it in the end ?? cat(mystring,file=testfile) Many thanks, Ashim [[alternative HTML version deleted]]

Re: [R] Generating the Ctrl-M character

2011-11-11 Thread Ashim Kapoor
--- Sent from my phone. Please excuse my brevity. David Winsemius dwinsem...@comcast.net wrote: On Nov 10, 2011, at 9:35 PM, Ashim Kapoor wrote: Dear R-helpers, I want to append a Ctrl-M character to a string and then save it to a text file. mystring

[R] Introducing \n's so that par.strip.text can produce multiline strips in lattice

2011-11-16 Thread Ashim Kapoor
Dear all, I have the following data, which has \\n in place of \n. I introduced \n's in the csv file so that I could use it in barchart in lattice. When I did that and read it into R using read.csv, it read it as \\n. My question is how do I introduce \n in the middle of a long string of quoted

[R] Drawing ticks in the 3rd and 4th row of a lattice

2011-11-17 Thread Ashim Kapoor
Dear all, I want to draw ticks on the 3rd and 4th row of a lattice. How do I do this ? In my search of the help, I discovered a parameter alternating,which kind of says where the ticks will be but does not suffice for me. I am running this command : - barchart(X03/1000~time|Company,

Re: [R] Introducing \n's so that par.strip.text can produce multiline strips in lattice

2011-11-17 Thread Ashim Kapoor
at 11:25 PM, Ashim Kapoor ashimkap...@gmail.com wrote: Dear all, I have the following data, which has \\n in place of \n. I introduced \n's in the csv file so that I could use it in barchart in lattice. When I did that and read it into R using read.csv, it read it as \\n. My question

Re: [R] Introducing \n's so that par.strip.text can produce multiline strips in lattice

2011-11-18 Thread Ashim Kapoor
Dear David, Thank you. That was very clear. I will try to make minimal examples in the future. Best Regards, Ashim On Fri, Nov 18, 2011 at 6:50 PM, David Winsemius dwinsem...@comcast.netwrote: On Nov 18, 2011, at 1:51 AM, Ashim Kapoor wrote: Dear Dennis, Many thanks.I was wondering

Re: [R] Drawing ticks in the 3rd and 4th row of a lattice

2011-12-01 Thread Ashim Kapoor
Dear Mr Sarkar, My apologies for not being articulate enough. Your solution worked perfectly. Many thanks, Ashim On Tue, Nov 22, 2011 at 9:12 PM, Deepayan Sarkar deepayan.sar...@gmail.comwrote: On Fri, Nov 18, 2011 at 11:22 AM, Ashim Kapoor ashimkap...@gmail.com wrote: Dear all, I want

Re: [R] text mining analysis and word visualization of pdfs

2011-05-18 Thread Ashim Kapoor
On Wed, May 18, 2011 at 1:44 PM, Karl Ove Hufthammer k...@huftis.orgwrote: Ajay Ohri wrote: What is the appropriate software package for dumping say 20 PDFS in a folder, then creating data visualization with frequency counts of certain words as well as measure correlation within each file

[R] Date format issue.

2011-06-28 Thread Ashim Kapoor
Dear R helpers, I have 2 questions : - 1. My excel sheet has a column with dates like 01/03/1980 which is formatted as 03/80 when I read this into R it reads as Mar-80. How can I read it in the source format ? 2. v-c(Mar-80) as.Date(v,format=%b-%y) [1] NA Could someone please tell me where

Re: [R] Date format issue.

2011-06-28 Thread Ashim Kapoor
You get the NA since it is indeterminate as to the date; paste on a 1 for the day Alright Jim, Many thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Upgrading R in Ubuntu

2011-06-29 Thread Ashim Kapoor
Dear All, I wanted to install the reshape package which in turn requires the plyr. When I tried to install plyr it says it needs ERROR: this R is version 2.10.1, package 'plyr' requires R = 2.11.0 My question is how do I upgrade my R ? I have Ubuntu 10.04.2 LTS. Many thanks for your help.

[R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
Dear R helpers, I have molten data which is : - t3 Year variablevalue 1 2005 ICICI.Bank 27488370 2 2006 ICICI.Bank 43166850 3 2007 ICICI.Bank 59515300 4 2008 ICICI.Bank 63085760 5 2009 ICICI.Bank 54526330 6 2005 HDFC.Bank

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
reshape_0.8.3 plyr_1.4 loaded via a namespace (and not attached): [1] digest_0.4.2 tools_2.13.0 Sarah On Thu, Jun 30, 2011 at 8:31 AM, Ashim Kapoor ashimkap...@gmail.com wrote: Dear R helpers, I have molten data which is : - t3 Year variablevalue 1 2005

Re: [R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Ashim Kapoor
8S 4M4 > Web: socserv.mcmaster.ca/jfox > > > > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ashim > > Kapoor > > Sent: June 4, 2016 5:33 AM > > To: peter dalgaard <pda...@gmail.com> > > Cc:

Re: [R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Ashim Kapoor
ander Version 2.2-0: Sat Jun 4 14:58:57 2016 [2] NOTE: Rcmdr Version 2.2-0 [3] NOTE: The dataset Anscombe has 51 rows and 4 columns. [4] ERROR: could not find function "grid" Best Regards, Ashim On Sat, Jun 4, 2016 at 2:50 PM, peter dalgaard <pda...@gmail.com> wrote: > >

[R] Error from Rcmdr when trying to make a density plot

2016-06-04 Thread Ashim Kapoor
Dear all, I am new to using Rcmdr. From the menu I chose the following : - data(Anscombe, package="car") densityPlot( ~ income, data=Anscombe, bw="SJ", adjust=1, kernel="gaussian") This gave me the following error:- [1] NOTE: R Commander Version 2.2-0: Sat Jun 4 12:32:09 2016 [2] NOTE: Rcmdr

Re: [R] [FORGED] Ask function missing in package car

2016-06-21 Thread Ashim Kapoor
he link [1]. > > > > 1. http://svitsrv25.epfl.ch/R-doc/library/car/html/Ask.html > > > > On Wed, Jun 22, 2016 at 6:57 AM, Rolf Turner <r.tur...@auckland.ac.nz> > > wrote: > > > >> On 22/06/16 13:06, Ashim Kapoor wrote: > >> > >&g

Re: [R] [FORGED] Ask function missing in package car

2016-06-21 Thread Ashim Kapoor
Dear Sir, Thank you. Best Regards, Ashim On Wed, Jun 22, 2016 at 10:47 AM, Fox, John <j...@mcmaster.ca> wrote: > Dear Ashim, > > > -Original Message----- > > From: Ashim Kapoor [mailto:ashimkap...@gmail.com] > > Sent: June 21, 2016 10:10 PM > > To: Fox,

[R] Ask function missing in package car

2016-06-21 Thread Ashim Kapoor
Dear All, my details:- > sessionInfo() R version 3.3.0 (2016-05-03) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 15.10 locale: [1] LC_CTYPE=en_IN LC_NUMERIC=C LC_TIME=en_IN [4] LC_COLLATE=en_IN LC_MONETARY=en_INLC_MESSAGES=en_IN [7] LC_PAPER=en_IN

Re: [R] [FORGED] Ask function missing in package car

2016-06-21 Thread Ashim Kapoor
/16 13:06, Ashim Kapoor wrote: > >> Dear All, >> >> my details:- >> >>> sessionInfo() >>> >> R version 3.3.0 (2016-05-03) >> Platform: x86_64-pc-linux-gnu (64-bit) >> Running under: Ubuntu 15.10 >> >> locale: >

Re: [R] [FORGED] Ask function missing in package car

2016-06-21 Thread Ashim Kapoor
- > John Fox, Professor > McMaster University > Hamilton, Ontario > Canada L8S 4M4 > Web: socserv.mcmaster.ca/jfox > > > > -Original Message----- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ashim > > Kapoor > > Sen

Re: [R] [FORGED] Ask function missing in package car

2016-06-22 Thread Ashim Kapoor
> - > David L Carlson > Department of Anthropology > Texas A University > College Station, TX 77840-4352 > > > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ashim > Kapoor >

[R] relevel for sigma constraint

2016-06-18 Thread Ashim Kapoor
Dear all, For treatment contrasts I would : library(car) data(Prestige) attach(Prestige) levels(type) contrasts(type) <-contr.treatment(levels(type),base =2 ) Alternatively to change my level I would do :- type = relevel(type,ref="prof") Now I want the sigma constraint. For this the LAST level

Re: [R] Interpreting summary.lm for a 2 factor anova

2016-12-02 Thread Ashim Kapoor
e the names of a few (active) statistics help list ? On Sat, Dec 3, 2016 at 1:33 AM, David Winsemius <dwinsem...@comcast.net> wrote: > > > On Dec 2, 2016, at 9:09 AM, David Winsemius <dwinsem...@comcast.net> > wrote: > > > >> > >> On Dec 2, 2016,

Re: [R] Interpreting summary.lm for a 2 factor anova

2016-12-02 Thread Ashim Kapoor
erts but it has something to > do with contrasts. > > ?contrasts > > Number 44.556 is mean for wool A and tension L and this is the level to > which every other level is compared. > > Cheers > Petr > > > -Original Message- > > From: R-help [mailto:r-

[R] Interpreting summary.lm for a 2 factor anova

2016-12-01 Thread Ashim Kapoor
Dear all, Here is a small example : - > model <- aov(breaks ~ wool * tension, data = warpbreaks) > summary.lm(model) Call: aov(formula = breaks ~ wool * tension, data = warpbreaks) Residuals: Min 1Q Median 3Q Max -19.5556 -6.8889 -0.6667 7.1944 25.

Re: [R] Interpreting summary.lm for a 2 factor anova

2016-12-03 Thread Ashim Kapoor
> John Fox, Professor > McMaster University > Hamilton, Ontario > Canada L8S 4M4 > Web: socserv.mcmaster.ca/jfox > > > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ashim > Kapoor > &g

Re: [R] Interpreting summary.lm for a 2 factor anova

2016-12-03 Thread Ashim Kapoor
On Sun, Dec 4, 2016 at 10:03 AM, Ashim Kapoor <ashimkap...@gmail.com> wrote: > Dear Sir, > > Many thanks for the explanation. Prior to your email (with some help from > a friend of mine) I was able to figure this one out. If we look at the > model : - > > y = intercep

Re: [R] Interpreting summary.lm for a 2 factor anova

2016-12-03 Thread Ashim Kapoor
> > For full understanding you will need to read in a text more about > sets of linear contrasts and their algebra. > I recommend Section 10.3 in mine, of course. > > Statistical Analysis and Data Display: > An Intermediate Course with Examples in R > Heiberger, Richard M., Ho

[R] Command for simple effects following 2 way anova with interaction

2016-11-30 Thread Ashim Kapoor
Dear All, Suppose I do :- head(warpbreaks) model1<- aov(breaks ~ wool*tension,data = warpbreaks) summary(model1) There is significant interaction. So I need to test for simple effects of wool at each level of tension and vice versa. I can do a subset and then do a one way anova for each level

[R] switch parameter in MSwM package

2017-03-23 Thread Ashim Kapoor
Dear All, I am currently trying to use the Markov Switching Models(MSwM) package in R.I am not sure as to how to use the switch parameter. From what I understand, switch is a boolean vector which says what parameters are regime dependent. My confusion is that what is the order of the parameters

Re: [R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
> > On 2017-04-17 7:58 AM, Ashim Kapoor wrote: > >> Dear All, >> >> set.seed(123) >> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) ) >> >> I expect to see 1 clear line,but I don't. What am I misunderstanding? >> > > &

Re: [R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
uot;1 clear line" quite well - for > most of the values. > > > B. > > > > > > On Apr 17, 2017, at 9:01 AM, Spencer Graves <spencer.graves@ > effectivedefense.org> wrote: > > > > > > > > On 2017-04-17 7:58 AM, Ashim Kapoor wrote:

[R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
Dear All, set.seed(123) qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) ) I expect to see 1 clear line,but I don't. What am I misunderstanding? Best Regards, Ashim [[alternative HTML version deleted]] __

Re: [R] qqplot for binomial distribution

2017-04-19 Thread Ashim Kapoor
ed", >lwd = 0.5) > ... and use your original qqplot() > > > B. > > > > On Apr 18, 2017, at 12:47 AM, Ashim Kapoor <ashimkap...@gmail.com> > wrote: > > > > Dear Boris, > > > > Thank you for your reply. > > > > > d

Re: [R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
=100, size=100, p=0.05), >rbinom(n=100, size=100, p=0.05) ) > > qqline(rbinom(n=100,size=100,p=.05), >distribution = function(probs) { qbinom(probs, size=100, prob=0.05) > }, >col = "red", >lwd = 0.5) > > > > > B. &

[R] The effect of tolerance in all.equal()

2017-04-25 Thread Ashim Kapoor
Dear all, I am not able to understand the interplay of absolute vs relative and tolerance in the use of all.equal If I want to find out if absolute differences between 2 numbers/vectors are bigger than a given tolerance I would do: all.equal(1,1.1,scale=1,tol= .1) If I want to find out if

Re: [R] qqplot for binomial distribution

2017-05-11 Thread Ashim Kapoor
7, 9, 8, 7, 2, 5, 4, 3, 7, 7, 2, 5, 4, 3, 3, 6, 10, 4, 9, 6, 5, 3, 4, 5, 5, 6, 6, 7, 3, 4, 8, 6, 4, 5, 1, 5, 9, 3, 6, 2, 4, 5, 5, 3, 3, 3, 3, 5, 4, 4, 5, 5, 1, 4, 5, 8, 7, 4, 3, 3, 5, 5, 4, 6, 5, 4, 7, 4, 4, 3, 3, 8, 4, 6, 7, 3, 4, 3, 5, 5, 7, 3, 6, 9, 7, 4, 3, 2, 6) On Wed, Apr 19, 2017 at 1

[R] regular expression help

2017-06-08 Thread Ashim Kapoor
Dear All, My query is: Do we always need to use perl = TRUE option when doing ignore.case=TRUE? A small example : my_text = "RECOVERY OFFICER-II\nDEBTS RECOVERY TRIBUNAL-III\n RC No. 162/2015\nSBI VS RAMESH GUPTA.\nDated: 01.03.2016 Item no.01\n Present: Ms. Sonakshi,

[R] Analysing the output from skmeans/clustering

2017-05-28 Thread Ashim Kapoor
Dear All, Here is a small example: library(skmeans) library(tm) data("crude") #Examine the first document inspect(crude[[1]]) dtm <- DocumentTermMatrix(crude, control = list(removePunctuation = TRUE, removeNumbers = TRUE,

Re: [R] regular expression help

2017-06-08 Thread Ashim Kapoor
Dear Enrico, Many thanks and Best Regards, Ashim. On Thu, Jun 8, 2017 at 5:11 PM, Enrico Schumann <e...@enricoschumann.net> wrote: > > Zitat von Ashim Kapoor <ashimkap...@gmail.com>: > > > Dear All, >> >> My query is: >> >> Do we always ne

[R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread Ashim Kapoor
Here is a small reproducible example: data <- structure(list(V1 = structure(1:3, .Label = c("Name1", "Name2", "Name3"), class = "factor"), V2 = structure(c(1L, 3L, 2L), .Label = c("nam1", "name-1", "name_12"), class = "factor"), V3 = structure(1:3, .Label = c("nam2", "nam_34", "name-2"), class =

Re: [R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread Ashim Kapoor
quot;Name2",..: 1 2 3 > $ V2: Factor w/ 3 levels "nam1","name-1",..: 1 3 2 > $ V3: Factor w/ 3 levels "nam2","nam_34",..: 1 2 3 > $ V4: Factor w/ 3 levels "","nam3","nam_56": 2 3 1 > $ V5: Factor w/ 2 level

[R] Keep only those values in a row in a data frame which occur only once.

2017-06-11 Thread Ashim Kapoor
Dear All, I have a file data.txt as follows: Name_1,A,B,C Name_2,E,F Name_3,I,J,I,K,L,M I will read this with: my_data<- read.csv("data.txt",header=FALSE,col.names=paste0("V", seq(1:10)),fill=TRUE) Then the file will have 10 columns. I am assuming that each row in data.txt will have at the max

[R] Perfect prediction of AR1 series using package dlm, posted on stack exchange

2017-05-04 Thread Ashim Kapoor
Dear all, I have made a dlm model,where I am getting a perfect prediction. Here is a link to the output: http://pasteboard.co/9IxVQwjm6.png The query and code is on: https://stats.stackexchange.com/questions/276449/perfect-prediction-in-case-of-a-univariate-ar1-model-using-dlm Can someone

Re: [R] The effect of tolerance in all.equal()

2017-04-30 Thread Ashim Kapoor
On Sun, Apr 30, 2017 at 10:05 PM, Duncan Murdoch <murdoch.dun...@gmail.com> wrote: > On 30/04/2017 12:26 PM, Ashim Kapoor wrote: > >> Dear All, >> >> This answer is very clear. Many thanks. >> >> I am now confused about how str*ucture works. Where can

Re: [R] The effect of tolerance in all.equal()

2017-04-30 Thread Ashim Kapoor
and chr make sense, what does language mean? I think I need to read some more. Many thanks, Ashim On Tue, Apr 25, 2017 at 3:14 PM, Martin Maechler <maech...@stat.math.ethz.ch > wrote: > >>>>> Ashim Kapoor <ashimkap...@gmail.com> > >>>>> on Tue, 25 Ap

Re: [R] Perfect prediction of AR1 series using package dlm, posted on stack exchange

2017-05-06 Thread Ashim Kapoor
asurement error on the state values, hence the > conditional distribution of theta_t given y_t is just the point value of > y_t... > > -pd > > > On 4 May 2017, at 12:05 , Ashim Kapoor <ashimkap...@gmail.com> wrote: > > > > Dear all, > > > &g

Re: [R] Default value of the option initial in the ses function in the forecast package.

2017-10-02 Thread Ashim Kapoor
Dear Peter, Many thanks, Ashim On Mon, Oct 2, 2017 at 3:30 PM, peter dalgaard <pda...@gmail.com> wrote: > The first one, i.e. "optimal"; check help for match.arg() for the idiom. > > -pd > > > > On 2 Oct 2017, at 11:48 , Ashim Kapoor <ashimkap...@gmail.co

[R] regex in maps package

2017-10-17 Thread Ashim Kapoor
Dear All, >From : ?maps::map we have : map(database = "world", regions = ".", exact = FALSE, boundary = TRUE, interior = TRUE, projection = "", parameters = NULL, orientation = NULL, fill = FALSE, col = 1, plot = TRUE, add = FALSE, namesonly = FALSE, xlim = NULL, ylim

[R] ggmap + geom_raster

2017-09-13 Thread Ashim Kapoor
Dear all, I want to : 1. Estimate a weighted 2D kernel. 2. Paint a heatmap on a ggmap. Here is some reproducible data / code (I got it from the internet) : s_rit <- structure(list(score = c(45, 60, 38, 98, 98, 53, 90, 42, 96, 45, 89, 18, 66, 2, 45, 98, 6, 83, 63, 86, 63, 81, 70, 8, 78, 15, 7,

[R] Default value of the option initial in the ses function in the forecast package.

2017-10-02 Thread Ashim Kapoor
Dear All, I am trying to use the function ses from the forecast package. >From its help I have : Usage: ses(y, h = 10, level = c(80, 95), fan = FALSE, initial = c("optimal", "simple"), alpha = NULL, lambda = NULL, biasadj = FALSE, x = y, ...) My query is that if I do not mention

[R] How to read PMML data from a text file and convert it to a model ?

2017-11-15 Thread Ashim Kapoor
Dear All, I want to save the XML representation of a model using PMML. Then I want to read the model and predict using the model and a new dataset. This is described in this blog post : https://www.r-bloggers.com/predictive-modeling-using-r-and-the-openscoring-engine-a-pmml-approach/ I am able

[R] Last page on a multi page, faceted graph created using ggforce, loses its layout under a certain condition

2018-06-01 Thread Ashim Kapoor
Dear All, I posted this query on stack overflow but I received no replies so I am posting it here so that someone here can take a look at this. My query is that suppose the variable I am faceting by has 40 categories and I want 3 categories per page( 1 row x 3 columns),then the last category

[R] clustering levels using Tukey HSD in a one way anova

2017-12-31 Thread Ashim Kapoor
Dear all, I am doing a one way between subjects anova in an unbalanced data set. Suppose we have "a" levels of the one factor. I want to merge the not so significantly different levels into the same cluster. Can I do a Tukey Kramer HSD and then use the following algorithm: For i in 2 : "a"

Re: [R] SpreadLevelPlot for more than one factor

2018-01-07 Thread Ashim Kapoor
1) / p ? Which one of the following is the final transformation ? Please clarify. > boxplot(breaks ^ -.2 ~v) > boxplot((breaks^-.2 -1)/(-.2)~v) > Best Regards, Ashim On Sun, Jan 7, 2018 at 10:59 AM, Ashim Kapoor <ashimkap...@gmail.com> wrote: > Dear All, > > w

Re: [R] SpreadLevelPlot for more than one factor

2018-01-06 Thread Ashim Kapoor
Dear All, we need to do : library(car) for the spreadLevelPlot function I forgot to say that. Apologies, Ashim On Sun, Jan 7, 2018 at 10:37 AM, Ashim Kapoor <ashimkap...@gmail.com> wrote: > Dear All, > > I want a transformation which will make the spread of the r

[R] SpreadLevelPlot for more than one factor

2018-01-06 Thread Ashim Kapoor
Dear All, I want a transformation which will make the spread of the response at all combinations of 2 factors the same. See for example : boxplot(breaks ~ tension * wool, warpbreaks) The closest I can do is : spreadLevelPlot(breaks ~tension , warpbreaks) spreadLevelPlot(breaks ~ wool ,

Re: [R] SpreadLevelPlot for more than one factor

2018-01-09 Thread Ashim Kapoor
ty > Hamilton, Ontario, Canada > Web: socialsciences.mcmaster.ca/jfox/ > > > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ashim > > Kapoor > > Sent: Sunday, January 7, 2018 12:08 AM > > To: r-help@r-proje

Re: [R] SpreadLevelPlot for more than one factor

2018-01-15 Thread Ashim Kapoor
ly because the data are balanced. > > Best, > John > > - > John Fox, Professor Emeritus > McMaster University > Hamilton, Ontario, Canada > Web: http://socserv.mcmaster.ca/jfox/ > > > > > On 2018-01-09, 10:18 AM, "Ashim Kapoor"

Re: [R] Unclear about the output from summary of ca.jo from package urca

2018-08-24 Thread Ashim Kapoor
t; sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Aug 23, 2018 at 2:12 AM Ashim Kapoor > wrote: > >> Dear All, >> >> I am not sure about the summary of the function ca.jo. I have posted m

[R] Unclear about the output from summary of ca.jo from package urca

2018-08-23 Thread Ashim Kapoor
Dear All, I am not sure about the summary of the function ca.jo. I have posted my query here :- https://stats.stackexchange.com/questions/363188/interpreting-the-names-used-in-the-output-of-johansen-test-in-package-urca-in-r I did not receive any reply so I am posting my query here. Many

[R] grepAMModelLib in package AMML not working as expected

2018-03-07 Thread Ashim Kapoor
Dear All, Here is a minimal working example : library(AMModels) mymodels <- amModelLib(description = "Simple AM Model library") dataset1 <- 1:100 dataset2 <- seq(2,200,2) model1 <- lm(dataset2~1) model2 <- lm(dataset2~ dataset1) m1 <- amModel(model = model1,comment = "Initial model.") m2 <-

Re: [R] Understanding which

2018-04-18 Thread Ashim Kapoor
le index values. > > Do you want > > x[ !( x > 100 ) ] > > ? > > On April 18, 2018 6:13:30 AM CDT, Ashim Kapoor <ashimkap...@gmail.com> > wrote: > >Dear All, > > > >Here is a reprex: > > > >> x<- 1:100 > >> x[-wh

[R] Understanding which

2018-04-18 Thread Ashim Kapoor
Dear All, Here is a reprex: > x<- 1:100 > x[-which(x>100)] integer(0) In words, I am finding out which indices correspond to values in x which are greater than 100 ( there are no such items ) . Then I remove those indices. I should get back the x that I started with since there are no items

[R] Output of arima

2018-11-13 Thread Ashim Kapoor
Dear All, Here is a reprex: set.seed(123) b <- arima.sim(list(order = c(1,0,0),ar= .9),n=1000,sd=1) arima(b) Call: arima(x = b) Coefficients: intercept 0.2250 s.e. 0.0688 sigma^2 estimated as 4.735: log likelihood = -2196.4, aic = 4396.81 > Should sigma^2 not be equal to

Re: [R] Output of arima

2018-11-14 Thread Ashim Kapoor
s.e. 0.0145 0.2783 > > sigma^2 estimated as 1.002: log likelihood = -1420.82, aic = 2847.63 > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Tue, Nov 13, 2018 at 4:02 AM, Ashim Kapoor > wrote: > >> Dear All, >> >> Here

Re: [R] Output of arima

2018-11-14 Thread Ashim Kapoor
coefficients, as requested/expected. > > HTH, > Eric > > > On Wed, Nov 14, 2018 at 12:08 PM Ashim Kapoor > wrote: > >> Dear Eric and William, >> >> Why do the 1st and 2nd incantation of arima return sigma^2 as 5.233 vs >> .? >> The help for arima

[R] Unable to compute Confidence Intervals from output from MARSS package

2019-01-22 Thread Ashim Kapoor
Dear All, I am trying to use this package ---> https://cran.r-project.org/web/packages/MARSS/index.html I am reading this book which shows some examples based on the above package ---> https://nwfsc-timeseries.github.io/atsa-labs/ In a few words, the incantation MARSS(...) estimates the

[R] Help needed regarding dlm model on stats.stackexchange

2018-11-23 Thread Ashim Kapoor
Dear all, I have created a time varying parameters regression. When I do that I have a parameter which is AR1. I am not able to recover this parameter. My query is posted here : https://stats.stackexchange.com/questions/377295/unable-to-recover-time-varying-ar1-parameter-from-state-space-model

[R] Reproducing the results from package dlm

2018-12-30 Thread Ashim Kapoor
Dear all, I have a query with regards to the package dlm. My query is : will dlm return the same results if I give it the same data set ? Here is a MWE ( created from : https://sites.ualberta.ca/~sfossati/e509/files/other/dlm_ex.R ) library(dlm) # simulate AR(1) process # phi = .8, sig2 = .25

Re: [R] Does R version 3.4.4 work on Ubuntu 18.04.1

2018-09-18 Thread Ashim Kapoor
saying it > can be *run* on Ubuntu 18.04.1.) > > Hope this helps, > > Rui Barradas > > > Às 06:51 de 18/09/2018, Ashim Kapoor escreveu: > > Dear All, > > > > I was reading this page ---> > > https://cran.r-project.org/bin/linux/ubuntu/README.html

[R] Does R version 3.4.4 work on Ubuntu 18.04.1

2018-09-18 Thread Ashim Kapoor
Dear All, I was reading this page ---> https://cran.r-project.org/bin/linux/ubuntu/README.html It says: R 3.4 packages for Ubuntu on i386 and amd64 are available for all stable Desktop releases of Ubuntu prior to Bionic Beaver (18.04) until their official end of life date. The page also shows

  1   2   >