Re: [R] List of data frame

2019-10-20 Thread ani jaya
Hai Rui,

It seems doesnt work for me, the "" still there.
So I used this one (Bert suggestion),

test<-lapply(test,function(x){x$RR[x$RR==] <- NA; x})

Best,
Ani






On Sat, Oct 19, 2019 at 6:55 PM Rui Barradas  wrote:

> Hello,
>
> Why not use read.xlsx argument 'na.strings', an argument that exists in
> many file reading functions? (read.table, and derivatives.)
>
>
> test <- lapply(sheets,function(i) {
>read.xlsx("rainfall.xlsx", sheet = i,
>  startRow = 8, cols = 1:2,
>  na.strings = "")
> })
>
>
> Hope this helps,
>
> Rui Barradas
>
> Às 02:38 de 18/10/19, ani jaya escreveu:
> > Dear R-Help,
> >
> > I have a list of data frame that I import from excel file using read.xlsx
> > command.
> >
> > sheets <- openxlsx::getSheetNames("rainfall.xlsx")
> > test <- lapply(sheets,function(i) read.xlsx("rainfall.xlsx", sheet=i,
> > startRow=8, cols=1:2))
> > names(test) <- sprintf("%i", 1986:2015)
> >
> > And I got a data.frame with 365 rows and two columns contains date and
> > rainfall data.
> > There is a value in rainfall data that i want to change as NA ()
> >
> > test[1]$`1986`
> > Date   RR
> > 1   01-01-19860
> > 2   02-01-19867
> > 3   03-01-1986   72
> > 4   04-01-19864
> > 5   05-01-1986   19
> > 6   06-01-19864
> > 7   07-01-1986   16
> > 8   08-01-1986   21
> > 9   09-01-1986   34
> > 10  10-01-1986   72
> > 11  11-01-1986   93
> > 12  12-01-1986  178
> > 13  13-01-1986   86
> > 14  14-01-1986   11
> > 15  15-01-19860
> > 16  16-01-1986   31
> > 17  17-01-1986   22
> > 18  18-01-1986   18
> > 19  19-01-19863
> > 20  20-01-19860
> > 21  21-01-1986   31
> > 22  22-01-1986   46
> > 23  23-01-19864
> > 24  24-01-1986   40
> > 25  25-01-1986   63
> > 26  26-01-1986  125
> > 27  27-01-1986   33
> > 28  28-01-1986   44
> > 29  29-01-19866
> > 30  30-01-19860
> > 31  31-01-19860
> > 32  01-02-19862
> > 33  02-02-1986   71
> > 34  03-02-1986 
> > 35  04-02-19860
> > 36  05-02-19860
> > 37  06-02-1986   56
> > 38  07-02-1986   19
> > 39  08-02-19863
> > 40  09-02-19867
> > 41  10-02-1986   24
> > 42  11-02-1986   55
> > 43  12-02-19860
> > 44  13-02-19860
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>

[[alternative HTML version deleted]]

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


Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread Jim Lemon
Hi Subhamitra,
This is not the only way to do this, but if you only want the monthly
averages, it is simple:

# I had to change the "soft" tabs in your email to commas
# in order to read the data in
spdf<-read.table(text="PERMNO,DATE,Spread
111,19940103,0.025464308
111,19940104,0.064424296
111,19940105,0.018579337
111,19940106,0.018872211
111,19940107,0.065279782
111,19940110,0.063485905
111,19940111,0.018355453
111,19940112,0.064135683
111,19940113,0.063519987
111,19940114,0.018277351
111,19940117,0.018628417
111,19940118,0.065630229
111,19940119,0.018713152
111,19940120,0.019119037
111,19940121,0.068342043
111,19940124,0.020843244
111,19940125,0.019954211
111,19940126,0.018980321
111,19940127,0.066827165
111,19940128,0.067459235
111,19940131,0.068682559
111,19940201,0.02081465
111,19940202,0.068236091
111,19940203,0.068821406
111,19940204,0.020075648
111,19940207,0.066070584
111,19940208,0.066068837
111,19940209,0.019077072
111,19940210,0.065894875
111,19940211,0.018847478
111,19940214,0.065040844
111,19940215,0.01880332
111,19940216,0.018836199
111,19940217,0.06665
111,19940218,0.067116793
111,19940221,0.068809742
111,19940222,0.068230213
111,19940223,0.069502855
111,19940224,0.070383523
111,19940225,0.020430811
111,19940228,0.067087257
111,19940301,0.066776479
111,19940302,0.019959031
111,19940303,0.066596469
111,19940304,0.019131334
111,19940307,0.019312528
111,19940308,0.067349909
111,19940309,0.068916431
111,19940310,0.068620043
111,19940311,0.070494844
111,19940314,0.071056842
111,19940315,0.071042517
111,19940316,0.072401771
111,19940317,0.071940001
111,19940318,0.07352884
111,19940321,0.072671688
111,19940322,0.072652595
111,19940323,0.021352138
111,19940324,0.069933727
111,19940325,0.068717467
111,19940328,0.020470748
111,19940329,0.020003748
111,19940330,0.065833717
111,19940331,0.065268388
111,19940401,0.018762356
111,19940404,0.064914179
111,19940405,0.064706743
111,19940406,0.018764175
111,19940407,0.06524806
111,19940408,0.018593449
111,19940411,0.064913949
111,19940412,0.01872089
111,19940413,0.018729328
111,19940414,0.018978773
111,19940415,0.065477137
111,19940418,0.064614365
111,19940419,0.064184148
111,19940420,0.018553192
111,19940421,0.066872771
111,19940422,0.06680782
111,19940425,0.067467961
111,19940426,0.02014297
111,19940427,0.062464016
111,19940428,0.062357052
112,19940429,0.000233993
112,19940103,0.000815264
112,19940104,0.000238165
112,19940105,0.000813632
112,19940106,0.000236915
112,19940107,0.000809102
112,19940110,0.000801642
112,19940111,0.000797932
112,19940112,0.000795251
112,19940113,0.000795186
112,19940114,0.000231359
112,19940117,0.000232134
112,19940118,0.000233718
112,19940119,0.000233993
112,19940120,0.000234694
112,19940121,0.000235753
112,19940124,0.000808653
112,19940125,0.000235604
112,19940126,0.000805068
112,19940127,0.000802337
112,19940128,0.000801768
112,19940131,0.000233517
112,19940201,0.000797431
112,19940202,0.00028
112,19940203,0.000233826
112,19940204,0.000799519
112,19940207,0.000798105
112,19940208,0.000792245
112,19940209,0.000231113
112,19940210,0.000233413
112,19940211,0.000798168
112,19940214,0.000233282
112,19940215,0.000797848
112,19940216,0.000785165
112,19940217,0.000228426
112,19940218,0.000786783
112,19940221,0.00078343
112,19940222,0.000781459
112,19940223,0.000776264
112,19940224,0.000226399
112,19940225,0.000779066
112,19940228,0.000773603
112,19940301,0.000226487
112,19940302,0.000775233
112,19940303,0.000227017
112,19940304,0.000227854
112,19940307,0.000782814
112,19940308,0.000229164
112,19940309,0.000787033
112,19940310,0.000784049
112,19940311,0.000228984
112,19940314,0.00078697
112,19940315,0.000782567
112,19940316,0.000228516
112,19940317,0.000786347
112,19940318,0.000229236
112,19940321,0.000230107
112,19940322,0.000792689
112,19940323,0.000787284
112,19940324,0.000787221
112,19940325,0.000227978",
header=TRUE,sep=",",stringsAsFactors=FALSE)
# split the year and month out of the date string
# as you have more than one year in your complete
# data set
spdf$yrmon<-substr(spdf$DATE,1,6)
# get the mean for each PERMNO and year/month
by(spdf$Spread,spdf[,c("PERMNO","yrmon")],mean)

Jim

On Sun, Oct 20, 2019 at 11:09 PM Subhamitra Patra <
subhamitra.pa...@gmail.com> wrote:

>
> Here, I am asking one more query (just for learning purpose) that if my
> country name and its respective variable is in the panel format, and I want
> to take the monthly average for each country, how the code will be
> arranged. For your convenience, I am providing a small data sample below.
>
>
>

[[alternative HTML version deleted]]

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


Re: [R] static vs. lexical scope

2019-10-20 Thread Francesco Ariis
Hello everyone again,
I much appreciated the explanations.

On Wed, Sep 25, 2019 at 11:02:42AM +0200, Francesco Ariis wrote:
> Maybe the Introduction should link to it (or similar page) with text
> "In case you are interest in the difference between static and lexical
> scope, check this explanation"?

Is any R-dev thinking about this?
I feel the nomenclature from the World Outside won't change any soon:
"Lexical scoping is also called static scoping." [1]

[1] 
http://courses.cs.washington.edu/courses/cse341/08au/general-concepts/scoping.html

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


Re: [R] Retaining attributes of columns of a data frame when subsetting.

2019-10-20 Thread Rolf Turner



On 21/10/19 11:07 AM, Rui Barradas wrote:


Hello,

Sorry, you're right, in the method it's x, X is the test dataframe.
Repost:

`[.myclass` <- function(x, i, j, drop = if (missing(i)) TRUE else 
length(cols) == 1){

   SaveAt <- lapply(x, attributes)
   x <- NextMethod()
   lX <- lapply(names(x),function(nm, x, Sat){
     attributes(x[[nm]]) <- Sat[[nm]]
     x[[nm]]}, x = x, Sat = SaveAt)
   names(lX) <- names(x)
   x <- as.data.frame(lX)
   x
}


The (frequent) error comes from tests where a X was created in the 
globalenv and found by the method.


Yep!  Happens to me all the time! :-)

Thanks very much.

cheers,

Rolf

--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

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


Re: [R] Preserving numeric columns

2019-10-20 Thread Jeff Newmiller
Well, the direct answer is "no", but then again I did not know the answer to 
the other question until I Googled it either.

When I do the same for grid.draw, it appears to be a generic function for 
drawing graphical objects... data frames are not grobs, so you must be doing 
something to convert it first.

I don't use grid graphics to produce tables... I use knitr::kable or the xtable 
or tables packages within Rmd or Rnw files.

On October 19, 2019 4:41:06 PM PDT, Felipe Carrillo  
wrote:
>Yes, options(knitr.kable.NA = '-')  is The answer for kable.
>Do you happen to know what are the arguments used for gridExtra
>grid.draw to acomplish the same thing?
>
>Sent from Yahoo Mail on Android 
> 
>On Sat, Oct 19, 2019 at 1:01 PM, Jeff
>Newmiller wrote:   Then the polite next step
>is for you to indicate what that solution was so people searching the
>archives can learn from your question. Was it to set the kable option?
>
>options(knitr.kable.NA = '-') 
>
>On October 19, 2019 12:50:20 PM PDT, Felipe Carrillo
> wrote:
>>You are correct. I didnt explain well and failed to mention that this
>>is for knitr::kable. I already figured it out. 
>>
>>Sent from Yahoo Mail on Android 
>> 
>>On Sat, Oct 19, 2019 at 1:04 AM, Jeff
>>Newmiller wrote:  Data frames are NOT
>>spreadsheets. Don't treat them like spreadsheets. All elements in a
>>column are parts of a vector which means they all have the same data
>>type.
>>
>>On the other hand, if you want to generate formatted output in HTML,
>>LaTeX, or Word, there are many tools for generating formatted tables
>in
>>the data output phase of data analysis, and it is common to convert
>>everything to character format intentionally then.
>>
>>On October 19, 2019 12:44:26 AM PDT, Felipe Carrillo via R-help
>> wrote:
>>>Consider the following dataset:  I need to replace NAs with "-" but I
>>>lose my numeric formatting  fall.estimate <- structure(list(`Salmon`
>=
>>>c("salmon River", "Ant Creek", "big Creek", "oso River", "linda
>>>Creek"), `baseline` = c(80874.384012, 361.1997, 5012.8311, 638.6912,
>>>402.1044), `target` = c(16, 720, 1, 450, 800), `1992`
>>=
>>>c(27618.4365, 0, 3587.61719, NA, NA), `1993` = c(100027.82328, NA,
>>>5647.83116, NA, NA), `1994` = c(99414.57438, NA, 12896.93753, NA,
>NA),
>>>`1995` = c(235027.00518, NA, 32059.63037, NA, NA), `1996` =
>>>c(143004.6423, NA, 17191.2152, NA, NA), `1997` = c(112796.88894, NA,
>>>27365.24435, NA, NA), `1998` = c(102858.8148, NA, 20539.17372, NA,
>>NA),
>>>`1999` = c(94113.26562, NA, 21916.44213, NA, NA)), row.names =
>>>c(NA, -5L), class = c("tbl_df", "tbl", "data.frame"))
>>>fall.estimatestr(fall.estimate)#convert to class
>>dataframefall.estimate
>>><- as.data.frame(fall.estimate)
>>>#Remove all decimalsfall.estimate[,-1]
>>><-round(fall.estimate[,-1],0)#Replace NA's' with dash
>>>'-'fall.estimate[is.na(fall.estimate)] <- "-"
>>>#Here all my columns get converted to character#Try to convert back
>to
>>>numericfall.estimate <- mutate_all(fall.estimate, function(x)
>>>as.numeric(as.character(x))) fall.estimate#But I get these warnings
>>>aand my dashes dissapearQuestion: How can I replace my NAs with
>dashes
>>>and keep all my dataframecolumns as numeric? Warning messages:1: In
>>>FUN(newX[, i], ...) : NAs introduced by coercion2: In FUN(newX[, i],
>>>...) : NAs introduced by coercion3: In FUN(newX[, i], ...) : NAs
>>>introduced by coercion4: In FUN(newX[, i], ...) : NAs introduced by
>>>coercion5: In FUN(newX[, i], ...) : NAs introduced by coercion6: In
>>>FUN(newX[, i], ...) : NAs introduced by coercion7: In FUN(newX[, i],
>>>...) : NAs introduced by coercion8: In FUN(newX[, i], ...) : NAs
>>>introduced by coercion9: In FUN(newX[, i], ...) : NAs introduced by
>>>coercion
>>>Thanks beforehand
>>>
>>>
>>>    [[alternative HTML version deleted]]
>>>
>>>__
>>>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide
>>>http://www.R-project.org/posting-guide.html
>>>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

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


Re: [R] Retaining attributes of columns of a data frame when subsetting.

2019-10-20 Thread Rui Barradas

Hello,

Sorry, you're right, in the method it's x, X is the test dataframe.
Repost:

`[.myclass` <- function(x, i, j, drop = if (missing(i)) TRUE else 
length(cols) == 1){

  SaveAt <- lapply(x, attributes)
  x <- NextMethod()
  lX <- lapply(names(x),function(nm, x, Sat){
attributes(x[[nm]]) <- Sat[[nm]]
x[[nm]]}, x = x, Sat = SaveAt)
  names(lX) <- names(x)
  x <- as.data.frame(lX)
  x
}


The (frequent) error comes from tests where a X was created in the 
globalenv and found by the method.


Rui Barradas

Às 22:55 de 20/10/19, Rolf Turner escreveu:


On 21/10/19 1:15 AM, Rui Barradas wrote:


Hello,

Richard's idea is good but shouldn't it be `[.myclass` instead?


Yes, I kind of thought that, and cobbled together something on that 
basis that seemed to work.  However my code was rather a hodge-podge.  I 
kept having to work around errors that I didn't understand.


You seem to have a much clearer understanding of what's going on, and 
your code is much cleaner than what I came up with.





`[.myclass` <- function(x, i, j, drop = if (missing(i)) TRUE else 
   length(cols) == 1){

   SaveAt <- lapply(X, attributes)
   X <- NextMethod()
   lX <- lapply(names(X),function(nm, x, Sat){
 attributes(x[[nm]]) <- Sat[[nm]]
 x[[nm]]}, x = X, Sat = SaveAt)
   names(lX) <- names(X)
   X <- as.data.frame(lX)
   X
}


But in the foregoing there seems to me to be some inconsistency in the 
use of "X" and "x".


Should not the first function argument be "X" rather than "x"?  Or 
perhaps the "X" symbols in the code should be replaced by "x"?  As in:


     SaveAt <- lapply(x, attributes)
     x <- NextMethod()
     
     

Or am I misunderstanding what's going on (as is so often
the case! :-( )?


X <- data.frame(a = letters[1:5], x = 1:5)
class(X) <- c("myclass", class(X))
attr(X$a, "attr_a1") <- "first_a"
attr(X$a, "attr_a2") <- "second_a"
str(X)

ok <- c(1, 3, 4)
X <- X[ok, ]
str(X)


Hope this helps,


Quite a lot!  But I'd appreciate clarification w.r.t. the misgiving that 
I expressed above.


Thanks.

cheers,

Rolf



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


Re: [R] Retaining attributes of columns of a data frame when subsetting.

2019-10-20 Thread Rolf Turner



On 21/10/19 1:15 AM, Rui Barradas wrote:


Hello,

Richard's idea is good but shouldn't it be `[.myclass` instead?


Yes, I kind of thought that, and cobbled together something on that 
basis that seemed to work.  However my code was rather a hodge-podge.  I 
kept having to work around errors that I didn't understand.


You seem to have a much clearer understanding of what's going on, and 
your code is much cleaner than what I came up with.





`[.myclass` <- function(x, i, j, drop = if (missing(i)) TRUE else 
   length(cols) == 1){

   SaveAt <- lapply(X, attributes)
   X <- NextMethod()
   lX <- lapply(names(X),function(nm, x, Sat){
     attributes(x[[nm]]) <- Sat[[nm]]
     x[[nm]]}, x = X, Sat = SaveAt)
   names(lX) <- names(X)
   X <- as.data.frame(lX)
   X
}


But in the foregoing there seems to me to be some inconsistency in the 
use of "X" and "x".


Should not the first function argument be "X" rather than "x"?  Or 
perhaps the "X" symbols in the code should be replaced by "x"?  As in:


SaveAt <- lapply(x, attributes)
x <- NextMethod()



Or am I misunderstanding what's going on (as is so often
the case! :-( )?


X <- data.frame(a = letters[1:5], x = 1:5)
class(X) <- c("myclass", class(X))
attr(X$a, "attr_a1") <- "first_a"
attr(X$a, "attr_a2") <- "second_a"
str(X)

ok <- c(1, 3, 4)
X <- X[ok, ]
str(X)


Hope this helps,


Quite a lot!  But I'd appreciate clarification w.r.t. the misgiving that 
I expressed above.


Thanks.

cheers,

Rolf

--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Peter Dalgaard
You're right. I was worried that c() would create a character vector and 
deparse the unevaluated call in the process, but apparently it is an implicit 
as.character _inside_ legend that is doing us in. (I can't offhand see where it 
is happening, but there might be scope for improvement if legend() would just 
accept a list object and treat the elements separately).

-pd

> On 20 Oct 2019, at 20:28 , Bert Gunter  wrote:
> 
> However, note that:
> 
> > class(c("Sans renard", bquote(.(densren) (ind./km)^2)))
> [1] "list"  # by coercion
> 
> so it does not seem necessary to explicitly call list(). That is:
> 
>plot(1:100,1:100,type="n")
>legend(list(x=0,y=100), legend = as.expression(c("Sans renard", 
> bquote(.(densren) (ind./km)^2))),lty=c(1,2),col=c("black","red"),bty="n")
> 
> appears to suffice. I would appreciate correction if I'm wrong about this.
> 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Bert Gunter
To continue down this rabbit hole ...

Actually, both solutions are the same; Peter's is just more general than
mine, as it works more conveniently for more lines in the legend.

However, note that:

> class(c("Sans renard", bquote(.(densren) (ind./km)^2)))
[1] "list"  # by coercion

so it does not seem necessary to explicitly call list(). That is:

   plot(1:100,1:100,type="n")
   legend(list(x=0,y=100), legend = as.expression(c("Sans renard",
bquote(.(densren) (ind./km)^2))),lty=c(1,2),col=c("black","red"),bty="n")

appears to suffice. I would appreciate correction if I'm wrong about this.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Oct 20, 2019 at 11:01 AM Patrick Giraudoux <
patrick.giraud...@univ-fcomte.fr> wrote:

> Now, we have two solutions working. This is great since I did not find
> any example of the kind searching r-help archives and google...
> Thanks !
>
> Le 20/10/2019 à 19:31, Peter Dalgaard a écrit :
> > It's tricky, but I think what you want is
> >
> > legend(list(x=0,y=100),
> > legend=as.expression(list(
> >   "Sans renard",
> >   bquote(.(densren) * " ind."/"km"^2)
> > )),
> > lty=c(1,2),col=c("black","red"),bty="n")
> >
> > Generally, if you want a vector of unevaluated expressions, you need an
> object of mode "expression", but you cannot create it directly with
> expression() because then the bquote() is left unevaluated:
> >
> >> expression("Sans renard",bquote(.(densren) * " ind."/"km"^2))
> > expression("Sans renard", bquote(.(densren) * " ind."/"km"^2))
> >
> > Putting the bquote on the outside _looks_ like it might work:
> >
> >> bquote(expression("Sans renard",.(densren) * " ind."/"km"^2))
> > expression("Sans renard", 1.25 * " ind."/"km"^2)
> >
> > but that is not an "expression" object, but a call to expression() (!).
> Try it and see.
> >
> > Evaluating the call does actually work (notice that the printed value is
> exactly the same, but the object is not):
> >
> >> eval(bquote(expression("Sans renard",.(densren) * " ind."/"km"^2)))
> > expression("Sans renard", 1.25 * " ind."/"km"^2)
> >
> > but I think I prefer the as.expression(list()) construction.
> >
> > An alternative tack is this:
> >
> >> e <- expression(0,0)
> >> e[[1]] <- "sans renard"
> >> e[[2]] <- bquote(.(densren) * " ind."/"km"^2)
> >> plot(1:100,1:100,type="n")
> >> legend(list(x=0,y=100),legend=e,
> lty=c(1,2),col=c("black","red"),bty="n")
> >
> >
> >> On 20 Oct 2019, at 18:02 , Patrick Giraudoux <
> patrick.giraud...@univ-fcomte.fr> wrote:
> >>
> >> Thanks Bert and Peter,
> >>
> >> Yes Bert, I was aware of the legend() function syntax, and just quoting
> the legend argument within the function.
> >>
> >> However, Bert and Peter, I do not understand why it works with your
> absolutely reproducible examples and not in the slightly (not so slightly
> apparently) different context where I used it...
> >>
> >> densren=1.25
> >> plot(1:100,1:100,type="n")
> >> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren)
> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
> >>
> >> densren=1.25
> >> plot(1:100,1:100,type="n")
> >> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) * "
> ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"
> >>
> >> Probably because the result of bquote() is concatenated in a character
> vector, but how to deal with this ?
> >>
> >> Best,
> >>
> >> Patrick
> >>
> >>
> >>
> >> Le 20/10/2019 à 16:42, Bert Gunter a écrit :
> >>> Assuming you are using base graphics, your syntax for adding the
> legend appears to be wrong.
> >>> legend() is a separate function, not a parameter of plot.default
> afaics.
> >>>
> >>> The following works for me:
> >>>
>  densren <- 1.25
>  plot(1:10)
>  legend (x="center", legend =bquote(.(densren) (ind./km)^2))
> >>> See ?legend
> >>>
> >>> Bert Gunter
> >>>
> >>> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> >>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> >>>
> >>>
> >>> On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux <
> patrick.giraud...@univ-fcomte.fr> wrote:
> >>> Dear listers,
> >>>
> >>> I am trying to pass an expression inlcuding a variable and a
> >>> superpscript to a legend. What I want to obtain is e.g. with densren =
> 1.25
> >>>
> >>> 1.25 ind./km^2
> >>>
> >>> I have tried many variants of the following:
> >>>
> >>> legend=bquote(.(densren) (ind./km)^2)
> >>>
> >>> but if not errors, do obtain
> >>>
> >>> 1.25 (ind./km^2)
> >>>
> >>> hence not what I want (no parenthesis, 2 in superscript...)
> >>>
> >>> Any idea about a correct syntax to get what I need ?
> >>>
> >>> Best,
> >>>
> >>> Patrick
> >>>
> >>>
> >>>  [[alternative HTML version deleted]]
> >>>
> >>> __
> >>> 

Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Patrick Giraudoux


Would be nice to put those two way examples in the documentation of the 
function 'expression' and 'bquote' in the next R version (we are in the 
base) for other users  ;-) I am sure many would enjoy.



Le 20/10/2019 à 19:15, Patrick Giraudoux a écrit :
> Great !  You have helped to solve a problem on which I was sweating 
> (sporadically, however) since months...
>
> Thanks,
>
> Best,
>
>
> Le 20/10/2019 à 18:29, Bert Gunter a écrit :
>> The legend must be "an expression vector."
>> c("Sans renard",bquote(.(densren) (ind./km)^2))   is not because the 
>> first element is a character string.
>>
>> This works:
>>
>> plot(1:100,1:100,type="n")
>>    legend(list(x=0,y=100),legend=c(expression("Sans 
>> renard"),bquote(.(densren) 
>> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
>>
>> Cheers,
>> Bert
>>
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming 
>> along and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>> On Sun, Oct 20, 2019 at 9:02 AM Patrick Giraudoux 
>> > > wrote:
>>
>> Thanks Bert and Peter,
>>
>> Yes Bert, I was aware of the legend() function syntax, and just
>> quoting the legend argument within the function.
>>
>> However, Bert and Peter, I do not understand why it works with
>> your absolutely reproducible examples and not in the slightly
>> (not so slightly apparently) different context where I used it...
>>
>> densren=1.25
>> plot(1:100,1:100,type="n")
>> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren)
>> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
>>
>> densren=1.25
>> plot(1:100,1:100,type="n")
>> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) *
>> " ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"
>>
>> Probably because the result of bquote() is concatenated in a
>> character vector, but how to deal with this ?
>>
>> Best,
>>
>> Patrick
>>
>>
>>
>> Le 20/10/2019 à 16:42, Bert Gunter a écrit :
>>> Assuming you are using base graphics, your syntax for adding the
>>> legend appears to be wrong.
>>> legend() is a separate function, not a parameter of plot.default
>>> afaics.
>>>
>>> The following works for me:
>>>
>>> > densren <- 1.25
>>> > plot(1:10)
>>> > legend (x="center", legend =bquote(.(densren) (ind./km)^2))
>>>
>>> See ?legend
>>>
>>> Bert Gunter
>>>
>>> "The trouble with having an open mind is that people keep coming
>>> along and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>>
>>>
>>> On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux
>>> >> > wrote:
>>>
>>> Dear listers,
>>>
>>> I am trying to pass an expression inlcuding a variable and a
>>> superpscript to a legend. What I want to obtain is e.g. with
>>> densren = 1.25
>>>
>>> 1.25 ind./km^2
>>>
>>> I have tried many variants of the following:
>>>
>>> legend=bquote(.(densren) (ind./km)^2)
>>>
>>> but if not errors, do obtain
>>>
>>> 1.25 (ind./km^2)
>>>
>>> hence not what I want (no parenthesis, 2 in superscript...)
>>>
>>> Any idea about a correct syntax to get what I need ?
>>>
>>> Best,
>>>
>>> Patrick
>>>
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org  mailing
>>> list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible
>>> code.
>>>
>>
>


[[alternative HTML version deleted]]

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Patrick Giraudoux
Now, we have two solutions working. This is great since I did not find 
any example of the kind searching r-help archives and google...

Thanks !

Le 20/10/2019 à 19:31, Peter Dalgaard a écrit :

It's tricky, but I think what you want is

legend(list(x=0,y=100),
legend=as.expression(list(
  "Sans renard",
  bquote(.(densren) * " ind."/"km"^2)
)),
lty=c(1,2),col=c("black","red"),bty="n")

Generally, if you want a vector of unevaluated expressions, you need an object of mode 
"expression", but you cannot create it directly with expression() because then 
the bquote() is left unevaluated:


expression("Sans renard",bquote(.(densren) * " ind."/"km"^2))

expression("Sans renard", bquote(.(densren) * " ind."/"km"^2))

Putting the bquote on the outside _looks_ like it might work:


bquote(expression("Sans renard",.(densren) * " ind."/"km"^2))

expression("Sans renard", 1.25 * " ind."/"km"^2)

but that is not an "expression" object, but a call to expression() (!). Try it 
and see.

Evaluating the call does actually work (notice that the printed value is 
exactly the same, but the object is not):


eval(bquote(expression("Sans renard",.(densren) * " ind."/"km"^2)))

expression("Sans renard", 1.25 * " ind."/"km"^2)

but I think I prefer the as.expression(list()) construction.

An alternative tack is this:


e <- expression(0,0)
e[[1]] <- "sans renard"
e[[2]] <- bquote(.(densren) * " ind."/"km"^2)
plot(1:100,1:100,type="n")
legend(list(x=0,y=100),legend=e, lty=c(1,2),col=c("black","red"),bty="n")




On 20 Oct 2019, at 18:02 , Patrick Giraudoux  
wrote:

Thanks Bert and Peter,

Yes Bert, I was aware of the legend() function syntax, and just quoting the 
legend argument within the function.

However, Bert and Peter, I do not understand why it works with your absolutely 
reproducible examples and not in the slightly (not so slightly apparently) 
different context where I used it...

densren=1.25
plot(1:100,1:100,type="n")
legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) 
(ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")

densren=1.25
plot(1:100,1:100,type="n")
legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) * " 
ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"

Probably because the result of bquote() is concatenated in a character vector, 
but how to deal with this ?

Best,

Patrick



Le 20/10/2019 à 16:42, Bert Gunter a écrit :

Assuming you are using base graphics, your syntax for adding the legend appears 
to be wrong.
legend() is a separate function, not a parameter of plot.default afaics.

The following works for me:


densren <- 1.25
plot(1:10)
legend (x="center", legend =bquote(.(densren) (ind./km)^2))

See ?legend

Bert Gunter

"The trouble with having an open mind is that people keep coming along and sticking 
things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux 
 wrote:
Dear listers,

I am trying to pass an expression inlcuding a variable and a
superpscript to a legend. What I want to obtain is e.g. with densren = 1.25

1.25 ind./km^2

I have tried many variants of the following:

legend=bquote(.(densren) (ind./km)^2)

but if not errors, do obtain

1.25 (ind./km^2)

hence not what I want (no parenthesis, 2 in superscript...)

Any idea about a correct syntax to get what I need ?

Best,

Patrick


 [[alternative HTML version deleted]]

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




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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Peter Dalgaard
It's tricky, but I think what you want is

legend(list(x=0,y=100),
   legend=as.expression(list(
 "Sans renard",
 bquote(.(densren) * " ind."/"km"^2)
   )),
   lty=c(1,2),col=c("black","red"),bty="n")

Generally, if you want a vector of unevaluated expressions, you need an object 
of mode "expression", but you cannot create it directly with expression() 
because then the bquote() is left unevaluated:

> expression("Sans renard",bquote(.(densren) * " ind."/"km"^2))
expression("Sans renard", bquote(.(densren) * " ind."/"km"^2))

Putting the bquote on the outside _looks_ like it might work:

> bquote(expression("Sans renard",.(densren) * " ind."/"km"^2))
expression("Sans renard", 1.25 * " ind."/"km"^2)

but that is not an "expression" object, but a call to expression() (!). Try it 
and see.

Evaluating the call does actually work (notice that the printed value is 
exactly the same, but the object is not):

> eval(bquote(expression("Sans renard",.(densren) * " ind."/"km"^2)))
expression("Sans renard", 1.25 * " ind."/"km"^2)

but I think I prefer the as.expression(list()) construction.

An alternative tack is this:

> e <- expression(0,0)
> e[[1]] <- "sans renard"
> e[[2]] <- bquote(.(densren) * " ind."/"km"^2)
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=e, lty=c(1,2),col=c("black","red"),bty="n")



> On 20 Oct 2019, at 18:02 , Patrick Giraudoux 
>  wrote:
> 
> Thanks Bert and Peter,
> 
> Yes Bert, I was aware of the legend() function syntax, and just quoting the 
> legend argument within the function. 
> 
> However, Bert and Peter, I do not understand why it works with your 
> absolutely reproducible examples and not in the slightly (not so slightly 
> apparently) different context where I used it...
> 
> densren=1.25
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) 
> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
> 
> densren=1.25
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) * " 
> ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"
> 
> Probably because the result of bquote() is concatenated in a character 
> vector, but how to deal with this ?
> 
> Best,
> 
> Patrick
> 
> 
> 
> Le 20/10/2019 à 16:42, Bert Gunter a écrit :
>> Assuming you are using base graphics, your syntax for adding the legend 
>> appears to be wrong.
>> legend() is a separate function, not a parameter of plot.default afaics.
>> 
>> The following works for me:
>> 
>> > densren <- 1.25
>> > plot(1:10)
>> > legend (x="center", legend =bquote(.(densren) (ind./km)^2))
>> 
>> See ?legend
>> 
>> Bert Gunter
>> 
>> "The trouble with having an open mind is that people keep coming along and 
>> sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>> 
>> 
>> On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux 
>>  wrote:
>> Dear listers,
>> 
>> I am trying to pass an expression inlcuding a variable and a 
>> superpscript to a legend. What I want to obtain is e.g. with densren = 1.25
>> 
>> 1.25 ind./km^2
>> 
>> I have tried many variants of the following:
>> 
>> legend=bquote(.(densren) (ind./km)^2)
>> 
>> but if not errors, do obtain
>> 
>> 1.25 (ind./km^2)
>> 
>> hence not what I want (no parenthesis, 2 in superscript...)
>> 
>> Any idea about a correct syntax to get what I need ?
>> 
>> Best,
>> 
>> Patrick
>> 
>> 
>> [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Patrick Giraudoux
Great !  You have helped to solve a problem on which I was sweating 
(sporadically, however) since months...

Thanks,

Best,


Le 20/10/2019 à 18:29, Bert Gunter a écrit :
> The legend must be "an expression vector."
> c("Sans renard",bquote(.(densren) (ind./km)^2))   is not because the 
> first element is a character string.
>
> This works:
>
> plot(1:100,1:100,type="n")
>    legend(list(x=0,y=100),legend=c(expression("Sans 
> renard"),bquote(.(densren) 
> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
>
> Cheers,
> Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along 
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Sun, Oct 20, 2019 at 9:02 AM Patrick Giraudoux 
>  > wrote:
>
> Thanks Bert and Peter,
>
> Yes Bert, I was aware of the legend() function syntax, and just
> quoting the legend argument within the function.
>
> However, Bert and Peter, I do not understand why it works with
> your absolutely reproducible examples and not in the slightly (not
> so slightly apparently) different context where I used it...
>
> densren=1.25
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren)
> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
>
> densren=1.25
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) *
> " ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"
>
> Probably because the result of bquote() is concatenated in a
> character vector, but how to deal with this ?
>
> Best,
>
> Patrick
>
>
>
> Le 20/10/2019 à 16:42, Bert Gunter a écrit :
>> Assuming you are using base graphics, your syntax for adding the
>> legend appears to be wrong.
>> legend() is a separate function, not a parameter of plot.default
>> afaics.
>>
>> The following works for me:
>>
>> > densren <- 1.25
>> > plot(1:10)
>> > legend (x="center", legend =bquote(.(densren) (ind./km)^2))
>>
>> See ?legend
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming
>> along and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>> On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux
>> > > wrote:
>>
>> Dear listers,
>>
>> I am trying to pass an expression inlcuding a variable and a
>> superpscript to a legend. What I want to obtain is e.g. with
>> densren = 1.25
>>
>> 1.25 ind./km^2
>>
>> I have tried many variants of the following:
>>
>> legend=bquote(.(densren) (ind./km)^2)
>>
>> but if not errors, do obtain
>>
>> 1.25 (ind./km^2)
>>
>> hence not what I want (no parenthesis, 2 in superscript...)
>>
>> Any idea about a correct syntax to get what I need ?
>>
>> Best,
>>
>> Patrick
>>
>>
>>         [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org  mailing
>> list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible
>> code.
>>
>


[[alternative HTML version deleted]]

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


Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread Rui Barradas

Hello,

Here are two other ways using aggregate.
The difference is in the way to create a MONTH grouping column.
The second way is base R only.


df1$MONTH <- zoo::as.yearmon(as.Date(as.character(df1$DATE), '%Y%m%d'))
aggregate(Spread ~ PERMNO + MONTH, df1, mean)

df1$MONTH <- df1$DATE %/% 100
aggregate(Spread ~ PERMNO + MONTH, df1, mean)


Hope this helps,

Rui Barradas


Às 17:17 de 20/10/19, jim holtman escreveu:

Does this do what you want:


library(tidyverse)



input <- read_delim("PERMNO DATE Spread

+ 111 19940103 0.025464308
+ 111 19940104 0.064424296
+ 111 19940105 0.018579337
+ 111 19940106 0.018872211
  ..." ... [TRUNCATED]


# drop last two digits to get the month
monthly <- input %>%

+   group_by(PERMNO, month = DATE %/% 100) %>%
+   summarise(avg = mean(Spread))

monthly

# A tibble: 12 x 3
# Groups:   PERMNO [3]
PERMNO  month  avg
   
  1111 199401 0.0416
  2111 199402 0.0508
  3111 199403 0.0567
  4111 199404 0.0466
  5112 199401 0.000533
  6112 199402 0.000593
  7112 199403 0.000471
  8112 199404 0.000587
  9113 199401 0.000692
10113 199402 0.000591
11113 199403 0.000677
12113 199404 0.000555





Jim Holtman
*Data Munger Guru*


*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*


On Sun, Oct 20, 2019 at 5:10 AM Subhamitra Patra 
wrote:


Dear Sir,

Thank you very much for your suggestions.

Due to certain inconveniences, I was unable to work on your suggestions.

Today I worked on both suggestions and got the result that I really wanted
that monthly averages for each country.

Here, I am asking one more query (just for learning purpose) that if my
country name and its respective variable is in the panel format, and I want
to take the monthly average for each country, how the code will be
arranged. For your convenience, I am providing a small data sample below.

PERMNO DATE Spread
111 19940103 0.025464308
111 19940104 0.064424296
111 19940105 0.018579337
111 19940106 0.018872211
111 19940107 0.065279782
111 19940110 0.063485905
111 19940111 0.018355453
111 19940112 0.064135683
111 19940113 0.063519987
111 19940114 0.018277351
111 19940117 0.018628417
111 19940118 0.065630229
111 19940119 0.018713152
111 19940120 0.019119037
111 19940121 0.068342043
111 19940124 0.020843244
111 19940125 0.019954211
111 19940126 0.018980321
111 19940127 0.066827165
111 19940128 0.067459235
111 19940131 0.068682559
111 19940201 0.02081465
111 19940202 0.068236091
111 19940203 0.068821406
111 19940204 0.020075648
111 19940207 0.066070584
111 19940208 0.066068837
111 19940209 0.019077072
111 19940210 0.065894875
111 19940211 0.018847478
111 19940214 0.065040844
111 19940215 0.01880332
111 19940216 0.018836199
111 19940217 0.06665
111 19940218 0.067116793
111 19940221 0.068809742
111 19940222 0.068230213
111 19940223 0.069502855
111 19940224 0.070383523
111 19940225 0.020430811
111 19940228 0.067087257
111 19940301 0.066776479
111 19940302 0.019959031
111 19940303 0.066596469
111 19940304 0.019131334
111 19940307 0.019312528
111 19940308 0.067349909
111 19940309 0.068916431
111 19940310 0.068620043
111 19940311 0.070494844
111 19940314 0.071056842
111 19940315 0.071042517
111 19940316 0.072401771
111 19940317 0.071940001
111 19940318 0.07352884
111 19940321 0.072671688
111 19940322 0.072652595
111 19940323 0.021352138
111 19940324 0.069933727
111 19940325 0.068717467
111 19940328 0.020470748
111 19940329 0.020003748
111 19940330 0.065833717
111 19940331 0.065268388
111 19940401 0.018762356
111 19940404 0.064914179
111 19940405 0.064706743
111 19940406 0.018764175
111 19940407 0.06524806
111 19940408 0.018593449
111 19940411 0.064913949
111 19940412 0.01872089
111 19940413 0.018729328
111 19940414 0.018978773
111 19940415 0.065477137
111 19940418 0.064614365
111 19940419 0.064184148
111 19940420 0.018553192
111 19940421 0.066872771
111 19940422 0.06680782
111 19940425 0.067467961
111 19940426 0.02014297
111 19940427 0.062464016
111 19940428 0.062357052
112 19940429 0.000233993
112 19940103 0.000815264
112 19940104 0.000238165
112 19940105 0.000813632
112 19940106 0.000236915
112 19940107 0.000809102
112 19940110 0.000801642
112 19940111 0.000797932
112 19940112 0.000795251
112 19940113 0.000795186
112 19940114 0.000231359
112 19940117 0.000232134
112 19940118 0.000233718
112 19940119 0.000233993
112 19940120 0.000234694
112 19940121 0.000235753
112 19940124 0.000808653
112 19940125 0.000235604
112 19940126 0.000805068
112 19940127 0.000802337
112 19940128 0.000801768
112 19940131 0.000233517
112 19940201 0.000797431
112 19940202 0.00028
112 19940203 0.000233826
112 19940204 0.000799519
112 19940207 0.000798105
112 19940208 0.000792245
112 19940209 0.000231113
112 19940210 0.000233413
112 19940211 0.000798168
112 19940214 0.000233282
112 19940215 0.000797848
112 19940216 0.000785165
112 19940217 0.000228426
112 19940218 0.000786783
112 19940221 0.00078343
112 19940222 0.000781459

Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Bert Gunter
The legend must be "an expression vector."
c("Sans renard",bquote(.(densren) (ind./km)^2))   is not because the first
element is a character string.

This works:

   plot(1:100,1:100,type="n")
   legend(list(x=0,y=100),legend=c(expression("Sans
renard"),bquote(.(densren)
(ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Oct 20, 2019 at 9:02 AM Patrick Giraudoux <
patrick.giraud...@univ-fcomte.fr> wrote:

> Thanks Bert and Peter,
>
> Yes Bert, I was aware of the legend() function syntax, and just quoting
> the legend argument within the function.
>
> However, Bert and Peter, I do not understand why it works with your
> absolutely reproducible examples and not in the slightly (not so slightly
> apparently) different context where I used it...
>
> densren=1.25
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren)
> (ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")
>
> densren=1.25
> plot(1:100,1:100,type="n")
> legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) * "
> ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"
>
> Probably because the result of bquote() is concatenated in a character
> vector, but how to deal with this ?
>
> Best,
>
> Patrick
>
>
>
> Le 20/10/2019 à 16:42, Bert Gunter a écrit :
>
> Assuming you are using base graphics, your syntax for adding the legend
> appears to be wrong.
> legend() is a separate function, not a parameter of plot.default afaics.
>
> The following works for me:
>
> > densren <- 1.25
> > plot(1:10)
> > legend (x="center", legend =bquote(.(densren) (ind./km)^2))
>
> See ?legend
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux <
> patrick.giraud...@univ-fcomte.fr> wrote:
>
>> Dear listers,
>>
>> I am trying to pass an expression inlcuding a variable and a
>> superpscript to a legend. What I want to obtain is e.g. with densren =
>> 1.25
>>
>> 1.25 ind./km^2
>>
>> I have tried many variants of the following:
>>
>> legend=bquote(.(densren) (ind./km)^2)
>>
>> but if not errors, do obtain
>>
>> 1.25 (ind./km^2)
>>
>> hence not what I want (no parenthesis, 2 in superscript...)
>>
>> Any idea about a correct syntax to get what I need ?
>>
>> Best,
>>
>> Patrick
>>
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

[[alternative HTML version deleted]]

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


Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread jim holtman
Does this do what you want:

> library(tidyverse)

> input <- read_delim("PERMNO DATE Spread
+ 111 19940103 0.025464308
+ 111 19940104 0.064424296
+ 111 19940105 0.018579337
+ 111 19940106 0.018872211
 ..." ... [TRUNCATED]

> # drop last two digits to get the month
> monthly <- input %>%
+   group_by(PERMNO, month = DATE %/% 100) %>%
+   summarise(avg = mean(Spread))
> monthly
# A tibble: 12 x 3
# Groups:   PERMNO [3]
   PERMNO  month  avg
  
 1111 199401 0.0416
 2111 199402 0.0508
 3111 199403 0.0567
 4111 199404 0.0466
 5112 199401 0.000533
 6112 199402 0.000593
 7112 199403 0.000471
 8112 199404 0.000587
 9113 199401 0.000692
10113 199402 0.000591
11113 199403 0.000677
12113 199404 0.000555
>


Jim Holtman
*Data Munger Guru*


*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*


On Sun, Oct 20, 2019 at 5:10 AM Subhamitra Patra 
wrote:

> Dear Sir,
>
> Thank you very much for your suggestions.
>
> Due to certain inconveniences, I was unable to work on your suggestions.
>
> Today I worked on both suggestions and got the result that I really wanted
> that monthly averages for each country.
>
> Here, I am asking one more query (just for learning purpose) that if my
> country name and its respective variable is in the panel format, and I want
> to take the monthly average for each country, how the code will be
> arranged. For your convenience, I am providing a small data sample below.
>
> PERMNO DATE Spread
> 111 19940103 0.025464308
> 111 19940104 0.064424296
> 111 19940105 0.018579337
> 111 19940106 0.018872211
> 111 19940107 0.065279782
> 111 19940110 0.063485905
> 111 19940111 0.018355453
> 111 19940112 0.064135683
> 111 19940113 0.063519987
> 111 19940114 0.018277351
> 111 19940117 0.018628417
> 111 19940118 0.065630229
> 111 19940119 0.018713152
> 111 19940120 0.019119037
> 111 19940121 0.068342043
> 111 19940124 0.020843244
> 111 19940125 0.019954211
> 111 19940126 0.018980321
> 111 19940127 0.066827165
> 111 19940128 0.067459235
> 111 19940131 0.068682559
> 111 19940201 0.02081465
> 111 19940202 0.068236091
> 111 19940203 0.068821406
> 111 19940204 0.020075648
> 111 19940207 0.066070584
> 111 19940208 0.066068837
> 111 19940209 0.019077072
> 111 19940210 0.065894875
> 111 19940211 0.018847478
> 111 19940214 0.065040844
> 111 19940215 0.01880332
> 111 19940216 0.018836199
> 111 19940217 0.06665
> 111 19940218 0.067116793
> 111 19940221 0.068809742
> 111 19940222 0.068230213
> 111 19940223 0.069502855
> 111 19940224 0.070383523
> 111 19940225 0.020430811
> 111 19940228 0.067087257
> 111 19940301 0.066776479
> 111 19940302 0.019959031
> 111 19940303 0.066596469
> 111 19940304 0.019131334
> 111 19940307 0.019312528
> 111 19940308 0.067349909
> 111 19940309 0.068916431
> 111 19940310 0.068620043
> 111 19940311 0.070494844
> 111 19940314 0.071056842
> 111 19940315 0.071042517
> 111 19940316 0.072401771
> 111 19940317 0.071940001
> 111 19940318 0.07352884
> 111 19940321 0.072671688
> 111 19940322 0.072652595
> 111 19940323 0.021352138
> 111 19940324 0.069933727
> 111 19940325 0.068717467
> 111 19940328 0.020470748
> 111 19940329 0.020003748
> 111 19940330 0.065833717
> 111 19940331 0.065268388
> 111 19940401 0.018762356
> 111 19940404 0.064914179
> 111 19940405 0.064706743
> 111 19940406 0.018764175
> 111 19940407 0.06524806
> 111 19940408 0.018593449
> 111 19940411 0.064913949
> 111 19940412 0.01872089
> 111 19940413 0.018729328
> 111 19940414 0.018978773
> 111 19940415 0.065477137
> 111 19940418 0.064614365
> 111 19940419 0.064184148
> 111 19940420 0.018553192
> 111 19940421 0.066872771
> 111 19940422 0.06680782
> 111 19940425 0.067467961
> 111 19940426 0.02014297
> 111 19940427 0.062464016
> 111 19940428 0.062357052
> 112 19940429 0.000233993
> 112 19940103 0.000815264
> 112 19940104 0.000238165
> 112 19940105 0.000813632
> 112 19940106 0.000236915
> 112 19940107 0.000809102
> 112 19940110 0.000801642
> 112 19940111 0.000797932
> 112 19940112 0.000795251
> 112 19940113 0.000795186
> 112 19940114 0.000231359
> 112 19940117 0.000232134
> 112 19940118 0.000233718
> 112 19940119 0.000233993
> 112 19940120 0.000234694
> 112 19940121 0.000235753
> 112 19940124 0.000808653
> 112 19940125 0.000235604
> 112 19940126 0.000805068
> 112 19940127 0.000802337
> 112 19940128 0.000801768
> 112 19940131 0.000233517
> 112 19940201 0.000797431
> 112 19940202 0.00028
> 112 19940203 0.000233826
> 112 19940204 0.000799519
> 112 19940207 0.000798105
> 112 19940208 0.000792245
> 112 19940209 0.000231113
> 112 19940210 0.000233413
> 112 19940211 0.000798168
> 112 19940214 0.000233282
> 112 19940215 0.000797848
> 112 19940216 0.000785165
> 112 19940217 0.000228426
> 112 19940218 0.000786783
> 112 19940221 0.00078343
> 112 19940222 0.000781459
> 112 19940223 0.000776264
> 112 19940224 0.000226399
> 112 19940225 0.000779066
> 112 19940228 0.000773603
> 112 19940301 0.000226487
> 112 19940302 0.000775233
> 112 

Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Patrick Giraudoux
Thanks Bert and Peter,

Yes Bert, I was aware of the legend() function syntax, and just quoting 
the legend argument within the function.

However, Bert and Peter, I do not understand why it works with your 
absolutely reproducible examples and not in the slightly (not so 
slightly apparently) different context where I used it...

densren=1.25
plot(1:100,1:100,type="n")
legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) 
(ind./km)^2)),lty=c(1,2),col=c("black","red"),bty="n")

densren=1.25
plot(1:100,1:100,type="n")
legend(list(x=0,y=100),legend=c("Sans renard",bquote(.(densren) * " 
ind."/"km"^2)),lty=c(1,2),col=c("black","red"),bty="n"

Probably because the result of bquote() is concatenated in a character 
vector, but how to deal with this ?

Best,

Patrick



Le 20/10/2019 à 16:42, Bert Gunter a écrit :
> Assuming you are using base graphics, your syntax for adding the 
> legend appears to be wrong.
> legend() is a separate function, not a parameter of plot.default afaics.
>
> The following works for me:
>
> > densren <- 1.25
> > plot(1:10)
> > legend (x="center", legend =bquote(.(densren) (ind./km)^2))
>
> See ?legend
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along 
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux 
>  > wrote:
>
> Dear listers,
>
> I am trying to pass an expression inlcuding a variable and a
> superpscript to a legend. What I want to obtain is e.g. with
> densren = 1.25
>
> 1.25 ind./km^2
>
> I have tried many variants of the following:
>
> legend=bquote(.(densren) (ind./km)^2)
>
> but if not errors, do obtain
>
> 1.25 (ind./km^2)
>
> hence not what I want (no parenthesis, 2 in superscript...)
>
> Any idea about a correct syntax to get what I need ?
>
> Best,
>
> Patrick
>
>
>         [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org  mailing list --
> To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


[[alternative HTML version deleted]]

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Bert Gunter
Assuming you are using base graphics, your syntax for adding the legend
appears to be wrong.
legend() is a separate function, not a parameter of plot.default afaics.

The following works for me:

> densren <- 1.25
> plot(1:10)
> legend (x="center", legend =bquote(.(densren) (ind./km)^2))

See ?legend

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Oct 20, 2019 at 5:30 AM Patrick Giraudoux <
patrick.giraud...@univ-fcomte.fr> wrote:

> Dear listers,
>
> I am trying to pass an expression inlcuding a variable and a
> superpscript to a legend. What I want to obtain is e.g. with densren = 1.25
>
> 1.25 ind./km^2
>
> I have tried many variants of the following:
>
> legend=bquote(.(densren) (ind./km)^2)
>
> but if not errors, do obtain
>
> 1.25 (ind./km^2)
>
> hence not what I want (no parenthesis, 2 in superscript...)
>
> Any idea about a correct syntax to get what I need ?
>
> Best,
>
> Patrick
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Patrick Giraudoux
Thanks Eric. I got it too already (and already tried some variations 
based on it), but to my understanding it does not include a variable 
whose contents is used in the expression as in the case submitted...


Le 20/10/2019 à 14:56, Eric Berger a écrit :
> I did a Google search on
>
> R plot superscript in legend
>
> and the first search result was
> https://stackoverflow.com/questions/20453408/superscript-r-squared-for-legend 
>
>  which looks like it might address your question.
>
> On Sun, Oct 20, 2019 at 3:30 PM Patrick Giraudoux 
>  > wrote:
>
> Dear listers,
>
> I am trying to pass an expression inlcuding a variable and a
> superpscript to a legend. What I want to obtain is e.g. with
> densren = 1.25
>
> 1.25 ind./km^2
>
> I have tried many variants of the following:
>
> legend=bquote(.(densren) (ind./km)^2)
>
> but if not errors, do obtain
>
> 1.25 (ind./km^2)
>
> hence not what I want (no parenthesis, 2 in superscript...)
>
> Any idea about a correct syntax to get what I need ?
>
> Best,
>
> Patrick
>
>
>         [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org  mailing list --
> To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


[[alternative HTML version deleted]]

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


Re: [R] using a variable and a superscript in a legend

2019-10-20 Thread Eric Berger
I did a Google search on

R plot superscript in legend

and the first search result was
https://stackoverflow.com/questions/20453408/superscript-r-squared-for-legend

 which looks like it might address your question.

On Sun, Oct 20, 2019 at 3:30 PM Patrick Giraudoux <
patrick.giraud...@univ-fcomte.fr> wrote:

> Dear listers,
>
> I am trying to pass an expression inlcuding a variable and a
> superpscript to a legend. What I want to obtain is e.g. with densren = 1.25
>
> 1.25 ind./km^2
>
> I have tried many variants of the following:
>
> legend=bquote(.(densren) (ind./km)^2)
>
> but if not errors, do obtain
>
> 1.25 (ind./km^2)
>
> hence not what I want (no parenthesis, 2 in superscript...)
>
> Any idea about a correct syntax to get what I need ?
>
> Best,
>
> Patrick
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


[R] using a variable and a superscript in a legend

2019-10-20 Thread Patrick Giraudoux
Dear listers,

I am trying to pass an expression inlcuding a variable and a 
superpscript to a legend. What I want to obtain is e.g. with densren = 1.25

1.25 ind./km^2

I have tried many variants of the following:

legend=bquote(.(densren) (ind./km)^2)

but if not errors, do obtain

1.25 (ind./km^2)

hence not what I want (no parenthesis, 2 in superscript...)

Any idea about a correct syntax to get what I need ?

Best,

Patrick


[[alternative HTML version deleted]]

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


Re: [R] Retaining attributes of columns of a data frame when subsetting.

2019-10-20 Thread Rui Barradas

Hello,

Richard's idea is good but shouldn't it be `[.myclass` instead?


`[.myclass` <- function(x, i, j, drop = if (missing(i)) TRUE else 
length(cols) == 1){

  SaveAt <- lapply(X, attributes)
  X <- NextMethod()
  lX <- lapply(names(X),function(nm, x, Sat){
attributes(x[[nm]]) <- Sat[[nm]]
x[[nm]]}, x = X, Sat = SaveAt)
  names(lX) <- names(X)
  X <- as.data.frame(lX)
  X
}

X <- data.frame(a = letters[1:5], x = 1:5)
class(X) <- c("myclass", class(X))
attr(X$a, "attr_a1") <- "first_a"
attr(X$a, "attr_a2") <- "second_a"
str(X)

ok <- c(1, 3, 4)
X <- X[ok, ]
str(X)


Hope this helps,

Rui Barradas

Às 03:13 de 20/10/19, Rolf Turner escreveu:

On 20/10/19 3:00 PM, Richard M. Heiberger wrote:

Look at
methods(as.data.frame)
Define your specialized columns to have a newly defined class, say 
"myclass".

Then write as.data.frame.myclass
It will be similar to the function you already have in the lapply 
statement.

Now your statement
X <- X[ok,]
should work.


Yes.  That idea does indeed look promising.  I'll check it out.
Thanks.

cheers,

Rolf



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


Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread Subhamitra Patra
Dear Sir,

Thank you very much for your suggestions.

Due to certain inconveniences, I was unable to work on your suggestions.

Today I worked on both suggestions and got the result that I really wanted
that monthly averages for each country.

Here, I am asking one more query (just for learning purpose) that if my
country name and its respective variable is in the panel format, and I want
to take the monthly average for each country, how the code will be
arranged. For your convenience, I am providing a small data sample below.

PERMNO DATE Spread
111 19940103 0.025464308
111 19940104 0.064424296
111 19940105 0.018579337
111 19940106 0.018872211
111 19940107 0.065279782
111 19940110 0.063485905
111 19940111 0.018355453
111 19940112 0.064135683
111 19940113 0.063519987
111 19940114 0.018277351
111 19940117 0.018628417
111 19940118 0.065630229
111 19940119 0.018713152
111 19940120 0.019119037
111 19940121 0.068342043
111 19940124 0.020843244
111 19940125 0.019954211
111 19940126 0.018980321
111 19940127 0.066827165
111 19940128 0.067459235
111 19940131 0.068682559
111 19940201 0.02081465
111 19940202 0.068236091
111 19940203 0.068821406
111 19940204 0.020075648
111 19940207 0.066070584
111 19940208 0.066068837
111 19940209 0.019077072
111 19940210 0.065894875
111 19940211 0.018847478
111 19940214 0.065040844
111 19940215 0.01880332
111 19940216 0.018836199
111 19940217 0.06665
111 19940218 0.067116793
111 19940221 0.068809742
111 19940222 0.068230213
111 19940223 0.069502855
111 19940224 0.070383523
111 19940225 0.020430811
111 19940228 0.067087257
111 19940301 0.066776479
111 19940302 0.019959031
111 19940303 0.066596469
111 19940304 0.019131334
111 19940307 0.019312528
111 19940308 0.067349909
111 19940309 0.068916431
111 19940310 0.068620043
111 19940311 0.070494844
111 19940314 0.071056842
111 19940315 0.071042517
111 19940316 0.072401771
111 19940317 0.071940001
111 19940318 0.07352884
111 19940321 0.072671688
111 19940322 0.072652595
111 19940323 0.021352138
111 19940324 0.069933727
111 19940325 0.068717467
111 19940328 0.020470748
111 19940329 0.020003748
111 19940330 0.065833717
111 19940331 0.065268388
111 19940401 0.018762356
111 19940404 0.064914179
111 19940405 0.064706743
111 19940406 0.018764175
111 19940407 0.06524806
111 19940408 0.018593449
111 19940411 0.064913949
111 19940412 0.01872089
111 19940413 0.018729328
111 19940414 0.018978773
111 19940415 0.065477137
111 19940418 0.064614365
111 19940419 0.064184148
111 19940420 0.018553192
111 19940421 0.066872771
111 19940422 0.06680782
111 19940425 0.067467961
111 19940426 0.02014297
111 19940427 0.062464016
111 19940428 0.062357052
112 19940429 0.000233993
112 19940103 0.000815264
112 19940104 0.000238165
112 19940105 0.000813632
112 19940106 0.000236915
112 19940107 0.000809102
112 19940110 0.000801642
112 19940111 0.000797932
112 19940112 0.000795251
112 19940113 0.000795186
112 19940114 0.000231359
112 19940117 0.000232134
112 19940118 0.000233718
112 19940119 0.000233993
112 19940120 0.000234694
112 19940121 0.000235753
112 19940124 0.000808653
112 19940125 0.000235604
112 19940126 0.000805068
112 19940127 0.000802337
112 19940128 0.000801768
112 19940131 0.000233517
112 19940201 0.000797431
112 19940202 0.00028
112 19940203 0.000233826
112 19940204 0.000799519
112 19940207 0.000798105
112 19940208 0.000792245
112 19940209 0.000231113
112 19940210 0.000233413
112 19940211 0.000798168
112 19940214 0.000233282
112 19940215 0.000797848
112 19940216 0.000785165
112 19940217 0.000228426
112 19940218 0.000786783
112 19940221 0.00078343
112 19940222 0.000781459
112 19940223 0.000776264
112 19940224 0.000226399
112 19940225 0.000779066
112 19940228 0.000773603
112 19940301 0.000226487
112 19940302 0.000775233
112 19940303 0.000227017
112 19940304 0.000227854
112 19940307 0.000782814
112 19940308 0.000229164
112 19940309 0.000787033
112 19940310 0.000784049
112 19940311 0.000228984
112 19940314 0.00078697
112 19940315 0.000782567
112 19940316 0.000228516
112 19940317 0.000786347
112 19940318 0.000229236
112 19940321 0.000230107
112 19940322 0.000792689
112 19940323 0.000787284
112 19940324 0.000787221
112 19940325 0.000227978
112 19940328 0.000228713
112 19940329 0.000228894
112 19940330 0.000229255
112 19940331 0.000231003
112 19940401 0.000796567
112 19940404 0.000790668
112 19940405 0.00078195
112 19940406 0.000780475
112 19940407 0.000228355
112 19940408 0.000781723
112 19940411 0.000775741
112 19940412 0.000226647
112 19940413 0.000778876
112 19940414 0.000777336
112 19940415 0.000775253
112 19940418 0.000226362
112 19940419 0.000779554
112 19940420 0.000774824
112 19940421 0.000225582
112 19940422 0.000225724
112 19940425 0.000773361
112 19940426 0.0002256
112 19940427 0.000776416
113 19940428 0.000280542
113 19940429 0.000964148
113 19940103 0.000962654
113 19940104 0.000281768
113 19940105 0.000962219
113 19940106 0.000961965
113 19940107 0.000958602
113 19940110 0.000280056
113 19940111 0.000956348
113 19940112 0.000952171
113