Re: [R] plotrix: Bug in `sizetree()` function

2021-07-29 Thread Jim Lemon
Hi Reza,
I just had a look at that and found the problem. I had not passed the
"showcount" argument in the recursive calls. The attached code, which will
be in the next version, seems to fix it.

Jim

On Fri, Jul 30, 2021 at 1:06 PM Reza Norouzian  wrote:

> Thanks a lot! In case the bug is fixed, I'd appreciate it if you could let
> me know.
>
> Thanks again,
> Reza
> *Reza Norouzian (he/him/his)*
> *Visiting Assistant Professor, Quantitative Methods*
> *Department of Educational Psychology*
> *The University of Texas at Austin*
> 1912 Speedway, Stop D5800
> Austin, TX 78712-1289
>
>
>
>
>
> On Thu, Jul 29, 2021 at 4:42 PM Jim Lemon  wrote:
>
>> Hi Reza,
>> Thanks for letting me know. I will get to this ASAP.
>>
>> Jim
>>
>> On Thu, Jul 29, 2021 at 11:21 PM Reza Norouzian 
>> wrote:
>> >
>> > Dear Jim,
>> >
>> > Thank you for the nice package. I just wanted to let you know that the
>> `showcount = FALSE` in the `siztree` function doesn't work properly and
>> that the function likely has a bug.
>> >
>> > I have reported this with a reproducible example on StackOverflow as
>> well, and others also confirmed it.
>> >
>> > Thanks for your attention,
>> > Reza
>> > Reza Norouzian (he/him/his)
>> > Visiting Assistant Professor, Quantitative Methods
>> > Department of Educational Psychology
>> > The University of Texas at Austin
>> > 1912 Speedway, Stop D5800
>> > Austin, TX 78712-1289
>> >
>> >
>> >
>>
>
__
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.


[ESS] ess-pdf-viewer-pref no longer used?

2021-07-29 Thread Tyler Smith via ESS-help

Hi,

I have ess-pdf-viewer-pref set to "emacsclient". This used to have 
the effect of opening pdfs in Emacs. It doesn't work anymore, and 
pdfs opened from ESS (e.g. vignettes) are now opened in the 
default pdf program for my OS (which is Evince on my machine).


Searching the code, the varaible `ess-pdf-viewer-pref` no longer 
exists, except for a few mentions in the changelog. None of the 
mentions indicate it has been deprecated. I didn't find any 
reference to pdfs in the manual either.


What is the current way to configure which programs are used to 
open pdfs from ESS?


Best,

Tyler

--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[R] RMariaDB returns a query without fractional seconds from MYSQL database

2021-07-29 Thread Baki UNAL via R-help
Hi

I created a table with following sql code in mysql:

CREATE TABLE pp_guniciislem201906.pp_201906 (
    date DATE,
    transaction_code VARCHAR(15),
    joint_agree_no VARCHAR(20),
    match_trade_item VARCHAR(15),
    buy_sell VARCHAR(15),
    num_transactions INT,
    paid_price FLOAT,
    trade_value FLOAT,
    order_no VARCHAR(20),
    trade_time TIME(6),
    trade_report INT,
    session VARCHAR(20),
    trade_status INT,
    settlement_date VARCHAR(5),
    assets_liabilities VARCHAR(1),
    trade_id INT,
    deal_id INT,
    update_time DATETIME,
    give_up_flag VARCHAR(1),
    update_no INT,
    update_time2 DATETIME    
);

I defined "trade_time" column with "TIME(6)". Because I have only time such as 
"09:55:02.113000" but not date.
Then I imported a csv file data to table with following sql code:

LOAD DATA INFILE 'G:\m201906.csv'
INTO TABLE pp_guniciislem201906.pp_201906
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n'
IGNORE 2 ROWS;

After that, when I query "SELECT * FROM pp_guniciislem201906.pp_201906;" from 
mysql "trade_time" column displays with fractional seconds. (I attached 
screenshot of mysql screen)

Then when I query from r with following code I could not get fractional 
seconds. I attached Rstudio screenshot image. As seen from this image in 
"trade_time" column fractional seconds are gone.


library(RMariaDB)

my_date <- '2019-06-24'

my_transaction_code <- 'AKBNK.E'

pp_201906 <- dbConnect(RMariaDB::MariaDB(), user='root', password='qazwsxedc', 
dbname='pp_guniciislem201906', host='localhost')

myquery <- paste("SELECT * FROM pp_201906 WHERE date='",my_date,"' AND 
transaction_code='",my_transaction_code,"'", sep="")

rs = dbSendQuery(pp_201906, myquery)

dbRows<-dbFetch(rs)


How can I solve this problem.
Best Regards
__
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] Unending loop

2021-07-29 Thread Ivan Krylov
Hi Nick,

Thanks for providing an example that doesn't seem to depend on external
data!

On Thu, 29 Jul 2021 09:07:12 +0100
Nick Wray  wrote:

> I am looking at the extRemes package

It's probable that there aren't many extRemes users on R-help, but if
you contact the maintainer of extRemes (run maintainer('extRemes') to
get their name and address), you might get help that way.

> When I run it on my own laptop it works fine, but when I run it on my
> uni laptop (which is pretty new and I only was given a couple of
> months ago) when it gets to the thresh.range line it goes into an
> unending loop (or something) with the little red Stop button, and
> just sits there.

If you interrupt it there, backtrace() will point you in the direction
of seemingly endless loop. You can also set options(error = recover)
and get a debugger prompt at the point where you interrupted the code
or in any other frame. See ?browser and RShowDoc('R-lang') part 9
"Debugging" for more information.

> I have R 4.0.4 on my uni laptop and R 4.0.5 on my own one.  Could
> this be the reason?

I'm afraid it's easier for you to answer this question. It should be
possible to install R on computers even without administrator access.
Can you reproduce the issue with
https://cloud.r-project.org/bin/windows/base/old/4.0.4/ on your own
laptop or https://cloud.r-project.org/bin/windows/base/old/4.0.5/ on the
university-issued one?

>   [[alternative HTML version deleted]]

This mailing list strips away the HTML part of multipart/mixed
messages, so to make sure that your messages look exactly as you type
them, please compose them in plain text.

-- 
Best regards,
Ivan

__
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] Unending loop

2021-07-29 Thread Nick Wray
Hello I don't know whether strictly speaking this is an R-help province
question but anyway...
I am looking at the extRemes package and have some code given beneath.
When I run it on my own laptop it works fine, but when I run it on my uni
laptop (which is pretty new and I only was given a couple of months ago)
when it gets to the thresh.range line it goes into an unending loop (or
something) with the little red Stop button, and just sits there.  I have R
4.0.4 on my uni laptop and R 4.0.5 on my own one.  Could this be the reason?

Thanks, Nick Wray

install.packages("extRemes")
library(extRemes)
data(Fort)
names(Fort)

bmFort <- blockmaxxer(Fort, blocks = Fort$year, which="Prec")
names(bmFort)

plot(Fort$year, Fort$Prec, xlab = "Year",
 ylab = "Precipitation (inches)",
 cex = 1.25, cex.lab = 1.25,
 col = "darkblue", bg = "lightblue", pch = 21)

points(bmFort$year, bmFort$Prec, col="darkred", cex=1.5)

# Fit a GEV distribution to annual maximum Precipitation
# in Fort Collins, Colorado, U.S.A.
fitGEV <- fevd(Prec, data = bmFort)
fitGEV
plot(fitGEV)
plot(fitGEV, "trace")

# Select a threshold for daily data from above.
threshrange.plot(Fort$Prec, c(0.1, 2), type = "PP")

# Fit the PP model to the daily data from above.
fitPP <- fevd(Prec, data = Fort, threshold = 0.395,
  type = "PP", units = "inches")
fitPP
plot(fitPP)

atdf(Fort$Prec, 0.395)

extremalindex(Fort$Prec, 0.395, blocks=Fort$year)

dcFort <- decluster(Fort$Prec, 0.395, r = 9)
plot(dcFort)

[[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.