Re: [R] importing data error question

2019-01-16 Thread Fox, John
Dear Jihee,

This appears to be a different problem. You were  apparently able to access the 
spreadsheet file, but the R Commander didn't find a suitable worksheet in it.

Try downloading and reading the file at 
. If 
that works, send me privately (i.e., directly) your Excel spreadsheet file and 
I'll take a look at it.

Best,
 John

> On Jan 16, 2019, at 9:49 PM, 우지희  wrote:
> 
> Dear John,
>  
> now i can use english thank you very much!!
>  
> um.. but nothing's changed... with that {r} message at R Markdown.
>  
> There's no dataset.
>  
> i tried both .xls and .xlsx .
>  
>  
> Jihee
>  
>  
>  
> 
>  
>  
>  
> From: "Fox, John" 
> Sent: Thursday, January 17, 2019 10:59:44 AM
> To:"우지희" 
> Cc:"" 
> Subject:Re: [R] importing data error question
>  
>  
> Dear Jihee,
> 
> Probably the easiest way to change the language to English temporarily in R 
> is to enter the command
> 
> Sys.setenv(LANGUAGE="en")
> 
> at the R command prompt prior to loading the Rcmdr package.
> 
> I hope that this helps,
> John
> 
> 
> > On Jan 16, 2019, at 7:02 PM, 우지희  wrote:
> > 
> > Thanks for your help!
> >  
> > I was having trouble with finding how to use english...
> >  
> > Even though I try to use english language, I couldn't change language of R 
> > commander. (it is still korean)
> >  
> > Sorry but.. do you know how to change language of "R commander"? I have no 
> > idea why it doesn't change.
> >  
> > Best,
> > Jihee
> >  
> > From: "Fox, John" 
> > Sent: Thursday, January 17, 2019 1:59:03 AM
> > To:"우지희" 
> > Cc:"r-help@r-project.org" 
> > Subject:Re: [R] importing data error question
> >  
> >  
> > Dear jihee,
> > 
> > I've looked into this problem further, using my Mac where it's easier to 
> > temporarily change languages and character sets than on Windows, and I 
> > discovered the following:
> > 
> > I was able to duplicate your problem with importing Excel files when 
> > working in Korean. There's a similar problem with the import SAS b7dat 
> > files but not with the other file-import dialogs.
> > 
> > I observed a similar problem when working in Chinese (LANG="zh") but not in 
> > simplified Chinese (zh_CN) or Japanese (ja), so the problem isn't simply 
> > with non-Latin character sets. There is no problem in English, Spanish 
> > (es), or French (fr), and I didn't check the other languages into which the 
> > Rcmdr is translated.
> > 
> > I think that the problem originates in the Korean and Chinese translation 
> > files and I'll contact the translators to see whether they can fix it.
> > 
> > Thank you for reporting this issue.
> > 
> > John
> > 
> > > On Jan 14, 2019, at 11:36 PM, Fox, John  wrote:
> > > 
> > > Dear jihee,
> > > 
> > >> On Jan 14, 2019, at 9:00 PM, 우지희  wrote:
> > >> 
> > >> You said previously that you were using a Mac, so I'm surprised that you 
> > >> now say that you're using Windows. I don't have a Windows 7 system, but 
> > >> I can confirm that importing from Excel files works perfectly fine under 
> > >> Windows 10, as I just verified, and I'd be surprised if the Windows 
> > >> version matters. 
> > >> 
> > >> --> no, I never said i was using a Mac. 
> > > 
> > > Sorry, I guess I got that from the error message you originally reported, 
> > > which was "Error in structure(.External(.C_dotTclObjv, objv), class = 
> > > "tclObj") : [tcl] bad Macintosh file type "“*”"." I've never seen that 
> > > error and it seems peculiar that it would occur on a Windows system.
> > > 
> > >> 
> > >> You still haven't reported the versions of R, the Rcmdr package, and the 
> > >> other packages that you're using. The easiest way to do this is to show 
> > >> the output of the sessionInfo() command. 
> > >> 
> > >> --> sessionInfo()
> > >> R version 3.5.2 (2018-12-20)
> > >> Platform: x86_64-w64-mingw32/x64 (64-bit)
> > >> Running under: Windows 7 x64 (build 7601) Service Pack 1
> > >> 
> > >> Matrix products: default
> > >> 
> > >> locale:
> > >> [1] LC_COLLATE=Korean_Korea.949 LC_CTYPE=Korean_Korea.949  
> > >> [3] LC_MONETARY=Korean_Korea.949 LC_NUMERIC=C  
> > >> [5] LC_TIME=Korean_Korea.949  
> > >> 
> > >> attached base packages:
> > >> [1] tcltk splines stats graphics grDevices utils datasets methods  
> > >> [9] base  
> > >> 
> > >> other attached packages:
> > >> [1] RcmdrPlugin.SensoMineR_1.11-01 RcmdrPlugin.FactoMineR_1.6-0  
> > >> [3] Rcmdr_2.5-1 effects_4.1-0  
> > >> [5] RcmdrMisc_2.5-1 sandwich_2.5-0  
> > >> [7] car_3.0-2 carData_3.0-2  
> > >> [9] SensoMineR_1.23 FactoMineR_1.41  
> > >> 
> > >> loaded via a namespace (and not attached):
> > >> [1] gtools_3.8.1 Formula_1.2-3 latticeExtra_0.6-28 
> > >> [4] cellranger_1.1.0 pillar_1.3.1 backports_1.1.3  
> > >> [7] lattice_0.20-38 digest_0.6.18 RColorBrewer_1.1-2  
> > >> [10] checkmate_1.8.5 minqa_1.2.4 colorspace_1.3-2  
> > >> [13] survey_3.35 htmltools_0.3.6 Matrix_1.2-15  
> > >> [16] plyr_1.8.4 pkgconfig_2.0.2 haven_2.0.0  
> > >> [19] 

Re: [R] importing data error question

2019-01-16 Thread Fox, John
Dear Jihee,

Probably the easiest way to change the language to English temporarily in R is 
to enter the command

Sys.setenv(LANGUAGE="en")

at the R command prompt prior to loading the Rcmdr package.

I hope that this helps,
 John


> On Jan 16, 2019, at 7:02 PM, 우지희  wrote:
> 
> Thanks for your help!
>  
> I was having trouble with finding how to use english...
>  
> Even though I try to use english language, I couldn't change language of R 
> commander. (it is still korean)
>  
> Sorry but.. do you know how to change language of "R commander"? I have no 
> idea why it doesn't change.
>  
> Best,
> Jihee
>  
> From: "Fox, John" 
> Sent: Thursday, January 17, 2019 1:59:03 AM
> To:"우지희" 
> Cc:"r-help@r-project.org" 
> Subject:Re: [R] importing data error question
>  
>  
> Dear jihee,
> 
> I've looked into this problem further, using my Mac where it's easier to 
> temporarily change languages and character sets than on Windows, and I 
> discovered the following:
> 
> I was able to duplicate your problem with importing Excel files when working 
> in Korean. There's a similar problem with the import SAS b7dat files but not 
> with the other file-import dialogs.
> 
> I observed a similar problem when working in Chinese (LANG="zh") but not in 
> simplified Chinese (zh_CN) or Japanese (ja), so the problem isn't simply with 
> non-Latin character sets. There is no problem in English, Spanish (es), or 
> French (fr), and I didn't check the other languages into which the Rcmdr is 
> translated.
> 
> I think that the problem originates in the Korean and Chinese translation 
> files and I'll contact the translators to see whether they can fix it.
> 
> Thank you for reporting this issue.
> 
> John
> 
> > On Jan 14, 2019, at 11:36 PM, Fox, John  wrote:
> > 
> > Dear jihee,
> > 
> >> On Jan 14, 2019, at 9:00 PM, 우지희  wrote:
> >> 
> >> You said previously that you were using a Mac, so I'm surprised that you 
> >> now say that you're using Windows. I don't have a Windows 7 system, but I 
> >> can confirm that importing from Excel files works perfectly fine under 
> >> Windows 10, as I just verified, and I'd be surprised if the Windows 
> >> version matters. 
> >> 
> >> --> no, I never said i was using a Mac. 
> > 
> > Sorry, I guess I got that from the error message you originally reported, 
> > which was "Error in structure(.External(.C_dotTclObjv, objv), class = 
> > "tclObj") : [tcl] bad Macintosh file type "“*”"." I've never seen that 
> > error and it seems peculiar that it would occur on a Windows system.
> > 
> >> 
> >> You still haven't reported the versions of R, the Rcmdr package, and the 
> >> other packages that you're using. The easiest way to do this is to show 
> >> the output of the sessionInfo() command. 
> >> 
> >> --> sessionInfo()
> >> R version 3.5.2 (2018-12-20)
> >> Platform: x86_64-w64-mingw32/x64 (64-bit)
> >> Running under: Windows 7 x64 (build 7601) Service Pack 1
> >> 
> >> Matrix products: default
> >> 
> >> locale:
> >> [1] LC_COLLATE=Korean_Korea.949 LC_CTYPE=Korean_Korea.949  
> >> [3] LC_MONETARY=Korean_Korea.949 LC_NUMERIC=C  
> >> [5] LC_TIME=Korean_Korea.949  
> >> 
> >> attached base packages:
> >> [1] tcltk splines stats graphics grDevices utils datasets methods  
> >> [9] base  
> >> 
> >> other attached packages:
> >> [1] RcmdrPlugin.SensoMineR_1.11-01 RcmdrPlugin.FactoMineR_1.6-0  
> >> [3] Rcmdr_2.5-1 effects_4.1-0  
> >> [5] RcmdrMisc_2.5-1 sandwich_2.5-0  
> >> [7] car_3.0-2 carData_3.0-2  
> >> [9] SensoMineR_1.23 FactoMineR_1.41  
> >> 
> >> loaded via a namespace (and not attached):
> >> [1] gtools_3.8.1 Formula_1.2-3 latticeExtra_0.6-28 
> >> [4] cellranger_1.1.0 pillar_1.3.1 backports_1.1.3  
> >> [7] lattice_0.20-38 digest_0.6.18 RColorBrewer_1.1-2  
> >> [10] checkmate_1.8.5 minqa_1.2.4 colorspace_1.3-2  
> >> [13] survey_3.35 htmltools_0.3.6 Matrix_1.2-15  
> >> [16] plyr_1.8.4 pkgconfig_2.0.2 haven_2.0.0  
> >> [19] scales_1.0.0 openxlsx_4.1.0 rio_0.5.16  
> >> [22] lme4_1.1-19 htmlTable_1.13.1 tibble_1.4.2  
> >> [25] relimp_1.0-5 ggplot2_3.1.0 nnet_7.3-12  
> >> [28] lazyeval_0.2.1 survival_2.43-3 magrittr_1.5  
> >> [31] crayon_1.3.4 readxl_1.2.0 nlme_3.1-137  
> >> [34] MASS_7.3-51.1 forcats_0.3.0 foreign_0.8-71  
> >> [37] class_7.3-14 tools_3.5.2 data.table_1.11.8  
> >> [40] hms_0.4.2 tcltk2_1.2-11 stringr_1.3.1  
> >> [43] munsell_0.5.0 cluster_2.0.7-1 zip_1.0.0  
> >> [46] flashClust_1.01-2 compiler_3.5.2 e1071_1.7-0  
> >> [49] rlang_0.3.1 grid_3.5.2 nloptr_1.2.1  
> >> [52] rstudioapi_0.9.0 htmlwidgets_1.3 leaps_3.0  
> >> [55] base64enc_0.1-3 gtable_0.2.0 abind_1.4-5  
> >> [58] curl_3.2 reshape2_1.4.3 AlgDesign_1.1-7.3  
> >> [61] gridExtra_2.3 zoo_1.8-4 knitr_1.21  
> >> [64] nortest_1.0-4 Hmisc_4.1-1 KernSmooth_2.23-15  
> >> [67] stringi_1.2.4 Rcpp_1.0.0 rpart_4.1-13  
> >> [70] acepack_1.4.1 scatterplot3d_0.3-41 xfun_0.4  
> >> 
> >> This was the status that I tried to import Excel data. 
> > 
> > These packages seem up-to-date.
> > 
> >> 
> 

Re: [R] Confusion Table

2019-01-16 Thread reichmanj
Ah yes - thank you

-Original Message-
From: Jeff Newmiller  
Sent: Wednesday, January 16, 2019 6:49 PM
To: r-help@r-project.org; reichm...@sbcglobal.net
Subject: Re: [R] Confusion Table

If you turn your character variable into a factor and specify the levels 
argument, you can control the sequence in which any discrete values are 
presented.

tst_pred <- factor( tst_pred, levels=c("No","Yes") )

On January 16, 2019 4:31:15 PM PST, reichm...@sbcglobal.net wrote:
>R-Help
>
> 
>
>R-Help community is there an simple straight forward way  of changing 
>my confusion table output to list "Yes" before "No" rather than "No"
>before
>"Yes" - R default.
>
> 
>
># Making predictions on the test set.
>
>tst_pred <- ifelse(predict(model_glm, newdata = default_tst, type =
>"response") > 0.5, "Yes", "No")
>
>tst_tab <- table(predicted = tst_pred, actual = default_tst$default)
>
>tst_tab
>
> 
>
>##actual
>
>## predicted   No  Yes
>
>##  No  4817  113
>
>##  Yes  1852
>
> 
>
>Jeff
>
>
>   [[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] Confusion Table

2019-01-16 Thread reichmanj
That's easy enough 

Thanks

-Original Message-
From: Peter Langfelder  
Sent: Wednesday, January 16, 2019 6:48 PM
To: reichm...@sbcglobal.net
Cc: r-help 
Subject: Re: [R] Confusion Table

The lazy way is to do

tst_tab = tst_tab[c(2,1), c(2,1)]

The less lazy way is something like

tst_tab <- table(predicted = factor(tst_pred, levels = c("Yes", "No")),  actual 
= factor(default_tst$default, levels = c("Yes",
"No")))

Peter

On Wed, Jan 16, 2019 at 4:39 PM  wrote:
>
> R-Help
>
>
>
> R-Help community is there an simple straight forward way  of changing 
> my confusion table output to list "Yes" before "No" rather than "No" 
> before "Yes" - R default.
>
>
>
> # Making predictions on the test set.
>
> tst_pred <- ifelse(predict(model_glm, newdata = default_tst, type =
> "response") > 0.5, "Yes", "No")
>
> tst_tab <- table(predicted = tst_pred, actual = default_tst$default)
>
> tst_tab
>
>
>
> ##actual
>
> ## predicted   No  Yes
>
> ##  No  4817  113
>
> ##  Yes  1852
>
>
>
> Jeff
>
>
> [[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] Confusion Table

2019-01-16 Thread Jeff Newmiller
If you turn your character variable into a factor and specify the levels 
argument, you can control the sequence in which any discrete values are 
presented.

tst_pred <- factor( tst_pred, levels=c("No","Yes") )

On January 16, 2019 4:31:15 PM PST, reichm...@sbcglobal.net wrote:
>R-Help
>
> 
>
>R-Help community is there an simple straight forward way  of changing
>my
>confusion table output to list "Yes" before "No" rather than "No"
>before
>"Yes" - R default.
>
> 
>
># Making predictions on the test set.
>
>tst_pred <- ifelse(predict(model_glm, newdata = default_tst, type =
>"response") > 0.5, "Yes", "No")
>
>tst_tab <- table(predicted = tst_pred, actual = default_tst$default)
>
>tst_tab
>
> 
>
>##actual
>
>## predicted   No  Yes
>
>##  No  4817  113
>
>##  Yes  1852
>
> 
>
>Jeff
>
>
>   [[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] Confusion Table

2019-01-16 Thread Peter Langfelder
The lazy way is to do

tst_tab = tst_tab[c(2,1), c(2,1)]

The less lazy way is something like

tst_tab <- table(predicted = factor(tst_pred, levels = c("Yes",
"No")),  actual = factor(default_tst$default, levels = c("Yes",
"No")))

Peter

On Wed, Jan 16, 2019 at 4:39 PM  wrote:
>
> R-Help
>
>
>
> R-Help community is there an simple straight forward way  of changing my
> confusion table output to list "Yes" before "No" rather than "No" before
> "Yes" - R default.
>
>
>
> # Making predictions on the test set.
>
> tst_pred <- ifelse(predict(model_glm, newdata = default_tst, type =
> "response") > 0.5, "Yes", "No")
>
> tst_tab <- table(predicted = tst_pred, actual = default_tst$default)
>
> tst_tab
>
>
>
> ##actual
>
> ## predicted   No  Yes
>
> ##  No  4817  113
>
> ##  Yes  1852
>
>
>
> Jeff
>
>
> [[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.


[R] Confusion Table

2019-01-16 Thread reichmanj
R-Help

 

R-Help community is there an simple straight forward way  of changing my
confusion table output to list "Yes" before "No" rather than "No" before
"Yes" - R default.

 

# Making predictions on the test set.

tst_pred <- ifelse(predict(model_glm, newdata = default_tst, type =
"response") > 0.5, "Yes", "No")

tst_tab <- table(predicted = tst_pred, actual = default_tst$default)

tst_tab

 

##actual

## predicted   No  Yes

##  No  4817  113

##  Yes  1852

 

Jeff


[[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] create groups from data with duplicates, such that each group has a duplicate represented once

2019-01-16 Thread Kevin Wamae
Hi, I have a sequencing run with ~3000 samples (attached dataset). The samples 
were initially tagged and amplified by PCR in duplicate. The tags used range 
from MID01 to MID26.

MID01-MID13 were used for pair 1 while MID14-MID26 were used for pair 2. The 
tags are re-used to allow samples to be pooled.

The pooling process will involve mixing samples with MID01-26 into the first 
group, the next group samples with MID01-26 into the second group and so on.

I'm hoping to get an R script that can create these groups such that for each 
group, any of the Tags appears only once. An example is shown below.

ID

TagA

TagB

group

180

MID03

MID10

group1

181

MID04

MID06

group1

182

MID05

MID07

group1

183

MID03

MID09

group2

184

MID04

MID10

group2

185

MID05

MID06

group2

186

MID01

MID06

group3

187

MID02

MID07

group3

188

MID03

MID08

group3



__

This e-mail contains information which is confidential. It is intended only for 
the use of the named recipient. If you have received this e-mail in error, 
please let us know by replying to the sender, and immediately delete it from 
your system.  Please note, that in these circumstances, the use, disclosure, 
distribution or copying of this information is strictly prohibited. 
KEMRI-Wellcome Trust Programme cannot accept any responsibility for the  
accuracy or completeness of this message as it has been transmitted over a 
public network. Although the Programme has taken reasonable precautions to 
ensure no viruses are present in emails, it cannot accept responsibility for 
any loss or damage arising from the use of the email or attachments. Any views 
expressed in this message are those of the individual sender, except where the 
sender specifically states them to be the views of KEMRI-Wellcome Trust 
Programme.
__
__
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] R Companion to Linear Statistical Models by KNNL

2019-01-16 Thread Bert Gunter
See here for relevant comments:

https://stats.stackexchange.com/questions/64406/r-code-for-kutner-et-als-applied-linear-statistical-models


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 Wed, Jan 16, 2019 at 3:51 PM AbouEl-Makarim Aboueissa <
abouelmakarim1...@gmail.com> wrote:

> Dear All:
>
>
> I am wondering if there is An R Companion to Linear Statistical Models
> *by  *Kutner, Nachtsheim, Neter, and Li. Any help would be appreciated.
>
>
> with many thanks
>
> abou
> __
>
>
> *AbouEl-Makarim Aboueissa, PhD*
>
> *Professor, Statistics and Data Science*
> *Graduate Coordinator*
>
> *Department of Mathematics and Statistics*
> *University of Southern Maine*
>
> [[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] R Companion to Linear Statistical Models by KNNL

2019-01-16 Thread AbouEl-Makarim Aboueissa
Dear All:


I am wondering if there is An R Companion to Linear Statistical Models
*by  *Kutner, Nachtsheim, Neter, and Li. Any help would be appreciated.


with many thanks

abou
__


*AbouEl-Makarim Aboueissa, PhD*

*Professor, Statistics and Data Science*
*Graduate Coordinator*

*Department of Mathematics and Statistics*
*University of Southern Maine*

[[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: [ESS] R Error splits code frame

2019-01-16 Thread Vitalie Spinu via ESS-help


Could you please add an issue to github with your frame configuration? I also
see some not-so nice dynamics with R buffers recently. We need to discuss this
in a bit more detail on the issue tracker.

  Vitalie

>> On Wed, Jan 16 2019 12:01, Johannes Aengenheyster via ESS-help wrote:

> Dear all, 
> For some months now, I basically have the exact same problem as here:
> https://grokbase.com/t/r/ess-help/1319gq8w1m/ess-error-message-in-r-now-splitting-frame.
>  I
> have one frame with an R process, and one (or more) frames with R code. As 
> soon
> as R produces an error, the code frame gets split in half and the R process is
> shown in the new window. Since I already have a frame with a R process, I do 
> not
> want this to happen. Anybody have an idea what to do? (I'm using emacs 26.1.50
> on ubuntu 16.04 with ESS 18.10.3) Thanks in advance!

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

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


Re: [R] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Jeff Newmiller
Indeed, if you repeat the code you provided before then the problem will not go 
away because you are not using the knowledge we have given you. You need to 
show us what you are trying differently based on the explanations provided on 
the mailing list. If you don't do this then we cannot move forward to more 
specific answers.

As a reminder:

> Execute your code line by line and solve the first error you
>encounter by examining the error message and reviewing what that line
>of code is designed to do.

On January 16, 2019 11:48:03 AM PST, N Meriam  wrote:
>Thanks for your valuable clarifications.
>I tried all the steps again but the problem remains.
>In fact,  "fviz_nbclust" is a function inside the package "factoextra".
>I run each step very carefully but the problem remains...It doesn't
>make sense because I have installed factoextra.
>
>This warning appears:
>could not find function "fviz_nbclust"
>
>On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller
> wrote:
>>
>> Concept 1: You don't install functions... you install packages that
>have functions in them. There is a function fviz_nbclust in factoextra.
>>
>> Concept 2: Once a package is installed, you do NOT have to install it
>again, e.g. every time you want to do that analysis. Making the
>installation part of your script is not advised.
>>
>> Concept 3: Typically we do use the library function with a package
>name at the beginning of every session where we want to use functions
>from that package. However, that is optional... you could also just
>invoke the function directly using
>factoextra::fviz_nbclust(...blahblah...). Having the library function
>shortens this and if the package is not installed it provides a clear
>error message that can be a reminder to the user to install the
>package.
>>
>> Execute your code line by line and solve the first error you
>encounter by examining the error message and reviewing what that line
>of code is designed to do.
>>
>> On January 16, 2019 11:00:07 AM PST, N Meriam 
>wrote:
>> >Hello,
>> >I'm struggling to install a function called "fviz_nbclus".
>> >
>> >My code is the following:
>> >pkgs <- c("factoextra",  "NbClust")
>> >install.packages(pkgs)
>> >library(factoextra)
>> >library(NbClust)
>> ># Standardize the data
>> >load("df4.rda")
>> >library(FunCluster)
>> >
>> >install.packages("fviz_nbclust")
>> >#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
>> >"gap_stat"))
>> >
>> >Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
>> >(as ‘lib’ is unspecified)
>> >Warning in install.packages :
>> >  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>> >
>> >Best,
>> >Meriam
>> >
>> >__
>> >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.

-- 
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] Error with install.packages using R v 3.5.1 and 3.5.2

2019-01-16 Thread Emily Wan
Henrik and Jeff -
Thank you both for your thoughts and helpful suggestions on this problem -
a colleague and I did some forensics on this end and discovered the issue
was related to a combination of 1) slow network connections and 2) having
my personal library installed on a different server from where R was
installed.  When we reassigned the libPath() to the "local drive" (same
virtual machine that R was installed on - after getting write permissions
for that drive), the issue was resolved.
Thank you both for your responses!

On Wed, Jan 16, 2019 at 2:42 PM Henrik Bengtsson 
wrote:

> Immediately after you get that error:
>
> Error in if (any(diff)) { : missing value where TRUE/FALSE needed
>
> what does
>
> > traceback()
>
> output?  (I suspect this error occurs in tools:::checkMD5sums() used
> to assert that the package files are correctly downloaded).  Also,
> going forward, let's try with a single package installed, e.g.
> install.packages("glue").   Does that also give an error?
>
> /Henrik
>
>
> On Wed, Jan 16, 2019 at 11:10 AM Jeff Newmiller
>  wrote:
> >
> > I don't know specifically where that error comes from... but I can think
> of two possible directions to go:
> >
> > 1) If you have ever run R as Administrator then you may need to delete
> your personal library (‘~/My Documents/R/win-library/3.5’) and reload all
> packages NOT using Run As Administrator. Any files created by R using those
> security credentials may impede the function of R when run without those
> credentials.
> >
> > 2) There have previously been reports that this error arises from the
> installed.packages function that is invoked by install.packages. This could
> be related to (1) above or be unrelated. You might confirm on this
> discussion thread whether this function runs okay for you.
> >
> > For future reference, use CRAN packages for examples on this mailing
> list to clarify that the problem is relevant here.
> >
> > On January 16, 2019 9:48:12 AM PST, Emily Wan <
> re...@channing.harvard.edu> wrote:
> > >Hi Jeff -
> > >I do not think the issue is Bioconductor (which is why I had posted the
> > >inquiry on this forum - but as an aside, I do have the latest version
> > >of
> > >Bioconductor (3.8)).   As an example, when I attempt to use the generic
> > >install.packages() function, I receive the same error message. I have
> > >included an example below (along with the sessionInfo):
> > >
> > >> install.packages('stringr')
> > >Installing package into ‘~/My Documents/R/win-library/3.5’
> > >(as ‘lib’ is unspecified)
> > >--- Please select a CRAN mirror for use in this session ---
> > >also installing the dependencies ‘glue’, ‘magrittr’
> > >trying URL '
> > >
> https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/glue_1.3.0.zip
> '
> > >Content type 'application/zip' length 108591 bytes (106 KB)
> > >downloaded 106 KB
> > >trying URL '
> > >
> https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/magrittr_1.5.zip
> > >'
> > >Content type 'application/zip' length 155452 bytes (151 KB)
> > >downloaded 151 KB
> > >trying URL '
> > >
> https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/stringr_1.3.1.zip
> > >'
> > >Content type 'application/zip' length 194247 bytes (189 KB)
> > >downloaded 189 KB
> > >Error in if (any(diff)) { : missing value where TRUE/FALSE needed
> > >> sessionInfo()
> > >R version 3.5.2 (2018-12-20)
> > >Platform: x86_64-w64-mingw32/x64 (64-bit)
> > >Running under: Windows Server 2012 R2 x64 (build 9600)
> > >Matrix products: default
> > >locale:
> > >[1] LC_COLLATE=English_United States.1252
> > >[2] LC_CTYPE=English_United States.1252
> > >[3] LC_MONETARY=English_United States.1252
> > >[4] LC_NUMERIC=C
> > >[5] LC_TIME=English_United States.1252
> > >attached base packages:
> > >[1] stats graphics  grDevices utils datasets  methods   base
> > >loaded via a namespace (and not attached):
> > >[1] compiler_3.5.2 tools_3.5.2
> > >>
> > >Please let me know what additional information is needed - many thanks.
> > >
> > >On Tue, Jan 15, 2019 at 4:51 PM Jeff Newmiller
> > >
> > >wrote:
> > >
> > >> Please ask questions about Bioconductor on the Bioconductor forum
> > >[1].
> > >>
> > >> Chances are that you need to re-install Bioconductor because packages
> > >are
> > >> installed in two-digit version-specific libraries... e.g. R 3.4 and R
> > >3.5
> > >> do not share packages.
> > >>
> > >> [1] https://support.bioconductor.org
> > >>
> > >> On January 15, 2019 11:51:16 AM PST, Emily Wan
> > >
> > >> wrote:
> > >> >Hi -
> > >> >I am working with R on a Window Server 2012 R2 - I had originally
> > >> >installed
> > >> >R (v3.5.1) in September/October 2018 and have used multiple packages
> > >> >without incident. However, last week, when attempting to install
> > >> >additional
> > >> >packages (using install.packages() or Bioconductor's
> > >> >BiocManager::install()
> > >> >wrapper), I kept on receiving the following error message:
> > >> >
> > >> >Error in if (any(diff)) { 

Re: [R] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread N Meriam
Thanks for your valuable clarifications.
I tried all the steps again but the problem remains.
In fact,  "fviz_nbclust" is a function inside the package "factoextra".
I run each step very carefully but the problem remains...It doesn't
make sense because I have installed factoextra.

This warning appears:
could not find function "fviz_nbclust"

On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller  wrote:
>
> Concept 1: You don't install functions... you install packages that have 
> functions in them. There is a function fviz_nbclust in factoextra.
>
> Concept 2: Once a package is installed, you do NOT have to install it again, 
> e.g. every time you want to do that analysis. Making the installation part of 
> your script is not advised.
>
> Concept 3: Typically we do use the library function with a package name at 
> the beginning of every session where we want to use functions from that 
> package. However, that is optional... you could also just invoke the function 
> directly using factoextra::fviz_nbclust(...blahblah...). Having the library 
> function shortens this and if the package is not installed it provides a 
> clear error message that can be a reminder to the user to install the package.
>
> Execute your code line by line and solve the first error you encounter by 
> examining the error message and reviewing what that line of code is designed 
> to do.
>
> On January 16, 2019 11:00:07 AM PST, N Meriam  wrote:
> >Hello,
> >I'm struggling to install a function called "fviz_nbclus".
> >
> >My code is the following:
> >pkgs <- c("factoextra",  "NbClust")
> >install.packages(pkgs)
> >library(factoextra)
> >library(NbClust)
> ># Standardize the data
> >load("df4.rda")
> >library(FunCluster)
> >
> >install.packages("fviz_nbclust")
> >#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
> >"gap_stat"))
> >
> >Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
> >(as ‘lib’ is unspecified)
> >Warning in install.packages :
> >  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
> >
> >Best,
> >Meriam
> >
> >__
> >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.



-- 
Meriam Nefzaoui
MSc. in Plant Breeding and Genetics
Universidade Federal Rural de Pernambuco (UFRPE) - Recife, Brazil

__
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] Error with install.packages using R v 3.5.1 and 3.5.2

2019-01-16 Thread Henrik Bengtsson
Immediately after you get that error:

Error in if (any(diff)) { : missing value where TRUE/FALSE needed

what does

> traceback()

output?  (I suspect this error occurs in tools:::checkMD5sums() used
to assert that the package files are correctly downloaded).  Also,
going forward, let's try with a single package installed, e.g.
install.packages("glue").   Does that also give an error?

/Henrik


On Wed, Jan 16, 2019 at 11:10 AM Jeff Newmiller
 wrote:
>
> I don't know specifically where that error comes from... but I can think of 
> two possible directions to go:
>
> 1) If you have ever run R as Administrator then you may need to delete your 
> personal library (‘~/My Documents/R/win-library/3.5’) and reload all packages 
> NOT using Run As Administrator. Any files created by R using those security 
> credentials may impede the function of R when run without those credentials.
>
> 2) There have previously been reports that this error arises from the 
> installed.packages function that is invoked by install.packages. This could 
> be related to (1) above or be unrelated. You might confirm on this discussion 
> thread whether this function runs okay for you.
>
> For future reference, use CRAN packages for examples on this mailing list to 
> clarify that the problem is relevant here.
>
> On January 16, 2019 9:48:12 AM PST, Emily Wan  
> wrote:
> >Hi Jeff -
> >I do not think the issue is Bioconductor (which is why I had posted the
> >inquiry on this forum - but as an aside, I do have the latest version
> >of
> >Bioconductor (3.8)).   As an example, when I attempt to use the generic
> >install.packages() function, I receive the same error message. I have
> >included an example below (along with the sessionInfo):
> >
> >> install.packages('stringr')
> >Installing package into ‘~/My Documents/R/win-library/3.5’
> >(as ‘lib’ is unspecified)
> >--- Please select a CRAN mirror for use in this session ---
> >also installing the dependencies ‘glue’, ‘magrittr’
> >trying URL '
> >https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/glue_1.3.0.zip'
> >Content type 'application/zip' length 108591 bytes (106 KB)
> >downloaded 106 KB
> >trying URL '
> >https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/magrittr_1.5.zip
> >'
> >Content type 'application/zip' length 155452 bytes (151 KB)
> >downloaded 151 KB
> >trying URL '
> >https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/stringr_1.3.1.zip
> >'
> >Content type 'application/zip' length 194247 bytes (189 KB)
> >downloaded 189 KB
> >Error in if (any(diff)) { : missing value where TRUE/FALSE needed
> >> sessionInfo()
> >R version 3.5.2 (2018-12-20)
> >Platform: x86_64-w64-mingw32/x64 (64-bit)
> >Running under: Windows Server 2012 R2 x64 (build 9600)
> >Matrix products: default
> >locale:
> >[1] LC_COLLATE=English_United States.1252
> >[2] LC_CTYPE=English_United States.1252
> >[3] LC_MONETARY=English_United States.1252
> >[4] LC_NUMERIC=C
> >[5] LC_TIME=English_United States.1252
> >attached base packages:
> >[1] stats graphics  grDevices utils datasets  methods   base
> >loaded via a namespace (and not attached):
> >[1] compiler_3.5.2 tools_3.5.2
> >>
> >Please let me know what additional information is needed - many thanks.
> >
> >On Tue, Jan 15, 2019 at 4:51 PM Jeff Newmiller
> >
> >wrote:
> >
> >> Please ask questions about Bioconductor on the Bioconductor forum
> >[1].
> >>
> >> Chances are that you need to re-install Bioconductor because packages
> >are
> >> installed in two-digit version-specific libraries... e.g. R 3.4 and R
> >3.5
> >> do not share packages.
> >>
> >> [1] https://support.bioconductor.org
> >>
> >> On January 15, 2019 11:51:16 AM PST, Emily Wan
> >
> >> wrote:
> >> >Hi -
> >> >I am working with R on a Window Server 2012 R2 - I had originally
> >> >installed
> >> >R (v3.5.1) in September/October 2018 and have used multiple packages
> >> >without incident. However, last week, when attempting to install
> >> >additional
> >> >packages (using install.packages() or Bioconductor's
> >> >BiocManager::install()
> >> >wrapper), I kept on receiving the following error message:
> >> >
> >> >Error in if (any(diff)) { : missing value where TRUE/FALSE needed
> >> >
> >> >I have searched the prior threads on this topic (including the issue
> >> >reported with R v3.4.0 which required a patch), rebooted my server,
> >and
> >> >actually uninstalled R v3.5.1 and upgraded to v3.5.2 but am still
> >> >receiving
> >> >the same error message when I attempt to install *any* package.
> >> >Please let me know what additional details I can provide to assist
> >with
> >> >troubleshooting. Thank you.
> >>
> >> --
> >> Sent from my phone. Please excuse my brevity.
> >>
>
> --
> 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 

Re: [R] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Jeff Newmiller
Concept 1: You don't install functions... you install packages that have 
functions in them. There is a function fviz_nbclust in factoextra.

Concept 2: Once a package is installed, you do NOT have to install it again, 
e.g. every time you want to do that analysis. Making the installation part of 
your script is not advised.

Concept 3: Typically we do use the library function with a package name at the 
beginning of every session where we want to use functions from that package. 
However, that is optional... you could also just invoke the function directly 
using factoextra::fviz_nbclust(...blahblah...). Having the library function 
shortens this and if the package is not installed it provides a clear error 
message that can be a reminder to the user to install the package.

Execute your code line by line and solve the first error you encounter by 
examining the error message and reviewing what that line of code is designed to 
do.

On January 16, 2019 11:00:07 AM PST, N Meriam  wrote:
>Hello,
>I'm struggling to install a function called "fviz_nbclus".
>
>My code is the following:
>pkgs <- c("factoextra",  "NbClust")
>install.packages(pkgs)
>library(factoextra)
>library(NbClust)
># Standardize the data
>load("df4.rda")
>library(FunCluster)
>
>install.packages("fviz_nbclust")
>#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
>"gap_stat"))
>
>Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
>(as ‘lib’ is unspecified)
>Warning in install.packages :
>  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>
>Best,
>Meriam
>
>__
>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] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Sarah Goslee
Hi,

fviz_nbclust is a function within the package factoextra. Once you
have installed the package and loaded it, you do not need to
explicitly install the function.

You probably also don't need FunCluster - I think you may be confusing
that package with the FUNcluster argument to the fviz_nbclust
function.

Do take a look at
?fviz_nbclust
for help and a working example.

library(factoextra)
library(NbClust)
# Standardize the data
load("df4.rda")
fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))

Sarah

On Wed, Jan 16, 2019 at 2:00 PM N Meriam  wrote:
>
> Hello,
> I'm struggling to install a function called "fviz_nbclus".
>
> My code is the following:
> pkgs <- c("factoextra",  "NbClust")
> install.packages(pkgs)
> library(factoextra)
> library(NbClust)
> # Standardize the data
> load("df4.rda")
> library(FunCluster)
>
> install.packages("fviz_nbclust")
> #fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))
>
> Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
> (as ‘lib’ is unspecified)
> Warning in install.packages :
>   package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>
> Best,
> Meriam
>
> __
> 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.



-- 
Sarah Goslee (she/her)
http://www.numberwright.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] NA rows appeared in data.frame

2019-01-16 Thread peter dalgaard
There is some logic to getting something that you don't know what is when you 
don't know whether you want it or not. It is certainly more informative than 
not getting anything, just like if you indexed with FALSE.

However, a more straightforward argument is that when you use integer indexing 
as a lookup table, as in

color <- c("red","blue")[gender]

then clearly you want NA if gender is NA. The rest then follows from coercion 
rules: NA is by default mode "logical" and much confusion could happen if 
x[NA]!=x[NA_integer], for instance x[c(1,NA)] != c(x[1], x[NA]).

-pd

> On 16 Jan 2019, at 08:29 , PIKAL Petr  wrote:
> 
> I believe that this behaviour has some reason, because you compare 2 to NA 
> and NA is basically "I do not know". So it could be 2 and therefore also rows 
> with NA are returned. If I am wrong, I hope R gurus will correct me.

-- 
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] Error with install.packages using R v 3.5.1 and 3.5.2

2019-01-16 Thread Jeff Newmiller
I don't know specifically where that error comes from... but I can think of two 
possible directions to go:

1) If you have ever run R as Administrator then you may need to delete your 
personal library (‘~/My Documents/R/win-library/3.5’) and reload all packages 
NOT using Run As Administrator. Any files created by R using those security 
credentials may impede the function of R when run without those credentials.

2) There have previously been reports that this error arises from the 
installed.packages function that is invoked by install.packages. This could be 
related to (1) above or be unrelated. You might confirm on this discussion 
thread whether this function runs okay for you.

For future reference, use CRAN packages for examples on this mailing list to 
clarify that the problem is relevant here.

On January 16, 2019 9:48:12 AM PST, Emily Wan  
wrote:
>Hi Jeff -
>I do not think the issue is Bioconductor (which is why I had posted the
>inquiry on this forum - but as an aside, I do have the latest version
>of
>Bioconductor (3.8)).   As an example, when I attempt to use the generic
>install.packages() function, I receive the same error message. I have
>included an example below (along with the sessionInfo):
>
>> install.packages('stringr')
>Installing package into ‘~/My Documents/R/win-library/3.5’
>(as ‘lib’ is unspecified)
>--- Please select a CRAN mirror for use in this session ---
>also installing the dependencies ‘glue’, ‘magrittr’
>trying URL '
>https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/glue_1.3.0.zip'
>Content type 'application/zip' length 108591 bytes (106 KB)
>downloaded 106 KB
>trying URL '
>https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/magrittr_1.5.zip
>'
>Content type 'application/zip' length 155452 bytes (151 KB)
>downloaded 151 KB
>trying URL '
>https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/stringr_1.3.1.zip
>'
>Content type 'application/zip' length 194247 bytes (189 KB)
>downloaded 189 KB
>Error in if (any(diff)) { : missing value where TRUE/FALSE needed
>> sessionInfo()
>R version 3.5.2 (2018-12-20)
>Platform: x86_64-w64-mingw32/x64 (64-bit)
>Running under: Windows Server 2012 R2 x64 (build 9600)
>Matrix products: default
>locale:
>[1] LC_COLLATE=English_United States.1252
>[2] LC_CTYPE=English_United States.1252
>[3] LC_MONETARY=English_United States.1252
>[4] LC_NUMERIC=C
>[5] LC_TIME=English_United States.1252
>attached base packages:
>[1] stats graphics  grDevices utils datasets  methods   base
>loaded via a namespace (and not attached):
>[1] compiler_3.5.2 tools_3.5.2
>>
>Please let me know what additional information is needed - many thanks.
>
>On Tue, Jan 15, 2019 at 4:51 PM Jeff Newmiller
>
>wrote:
>
>> Please ask questions about Bioconductor on the Bioconductor forum
>[1].
>>
>> Chances are that you need to re-install Bioconductor because packages
>are
>> installed in two-digit version-specific libraries... e.g. R 3.4 and R
>3.5
>> do not share packages.
>>
>> [1] https://support.bioconductor.org
>>
>> On January 15, 2019 11:51:16 AM PST, Emily Wan
>
>> wrote:
>> >Hi -
>> >I am working with R on a Window Server 2012 R2 - I had originally
>> >installed
>> >R (v3.5.1) in September/October 2018 and have used multiple packages
>> >without incident. However, last week, when attempting to install
>> >additional
>> >packages (using install.packages() or Bioconductor's
>> >BiocManager::install()
>> >wrapper), I kept on receiving the following error message:
>> >
>> >Error in if (any(diff)) { : missing value where TRUE/FALSE needed
>> >
>> >I have searched the prior threads on this topic (including the issue
>> >reported with R v3.4.0 which required a patch), rebooted my server,
>and
>> >actually uninstalled R v3.5.1 and upgraded to v3.5.2 but am still
>> >receiving
>> >the same error message when I attempt to install *any* package.
>> >Please let me know what additional details I can provide to assist
>with
>> >troubleshooting. Thank you.
>>
>> --
>> Sent from my phone. Please excuse my brevity.
>>

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


[ESS] R Error splits code frame

2019-01-16 Thread Johannes Aengenheyster via ESS-help


Dear all, 
For some months now, I basically have the exact same problem as here: 
https://grokbase.com/t/r/ess-help/1319gq8w1m/ess-error-message-in-r-now-splitting-frame.
 I have one frame with an R process, and one (or more) frames with R code. As 
soon as R produces an error, the code frame gets split in half and the R 
process is shown in the new window. Since I already have a frame with a R 
process, I do not want this to happen. Anybody have an idea what to do? (I'm 
using emacs 26.1.50 on ubuntu 16.04 with ESS 18.10.3) Thanks in advance!

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


[R] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread N Meriam
Hello,
I'm struggling to install a function called "fviz_nbclus".

My code is the following:
pkgs <- c("factoextra",  "NbClust")
install.packages(pkgs)
library(factoextra)
library(NbClust)
# Standardize the data
load("df4.rda")
library(FunCluster)

install.packages("fviz_nbclust")
#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))

Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘fviz_nbclust’ is not available (for R version 3.5.2)

Best,
Meriam

__
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] Error with install.packages using R v 3.5.1 and 3.5.2

2019-01-16 Thread Emily Wan
Hi Jeff -
I do not think the issue is Bioconductor (which is why I had posted the
inquiry on this forum - but as an aside, I do have the latest version of
Bioconductor (3.8)).   As an example, when I attempt to use the generic
install.packages() function, I receive the same error message. I have
included an example below (along with the sessionInfo):

> install.packages('stringr')
Installing package into ‘~/My Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘glue’, ‘magrittr’
trying URL '
https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/glue_1.3.0.zip'
Content type 'application/zip' length 108591 bytes (106 KB)
downloaded 106 KB
trying URL '
https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/magrittr_1.5.zip
'
Content type 'application/zip' length 155452 bytes (151 KB)
downloaded 151 KB
trying URL '
https://cran.revolutionanalytics.com/bin/windows/contrib/3.5/stringr_1.3.1.zip
'
Content type 'application/zip' length 194247 bytes (189 KB)
downloaded 189 KB
Error in if (any(diff)) { : missing value where TRUE/FALSE needed
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2012 R2 x64 (build 9600)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base
loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2
>
Please let me know what additional information is needed - many thanks.

On Tue, Jan 15, 2019 at 4:51 PM Jeff Newmiller 
wrote:

> Please ask questions about Bioconductor on the Bioconductor forum [1].
>
> Chances are that you need to re-install Bioconductor because packages are
> installed in two-digit version-specific libraries... e.g. R 3.4 and R 3.5
> do not share packages.
>
> [1] https://support.bioconductor.org
>
> On January 15, 2019 11:51:16 AM PST, Emily Wan 
> wrote:
> >Hi -
> >I am working with R on a Window Server 2012 R2 - I had originally
> >installed
> >R (v3.5.1) in September/October 2018 and have used multiple packages
> >without incident. However, last week, when attempting to install
> >additional
> >packages (using install.packages() or Bioconductor's
> >BiocManager::install()
> >wrapper), I kept on receiving the following error message:
> >
> >Error in if (any(diff)) { : missing value where TRUE/FALSE needed
> >
> >I have searched the prior threads on this topic (including the issue
> >reported with R v3.4.0 which required a patch), rebooted my server, and
> >actually uninstalled R v3.5.1 and upgraded to v3.5.2 but am still
> >receiving
> >the same error message when I attempt to install *any* package.
> >Please let me know what additional details I can provide to assist with
> >troubleshooting. Thank you.
>
> --
> Sent from my phone. Please excuse my brevity.
>

-- 
The information in this e-mail is intended only for the ...{{dropped:18}}

__
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] importing data error question

2019-01-16 Thread Fox, John
Dear jihee,

I've looked into this problem further, using my Mac where it's easier to 
temporarily change languages and character sets than on Windows, and I 
discovered the following:

I was able to duplicate your problem with importing Excel files when working in 
Korean. There's a similar problem with the import SAS b7dat files but not with 
the other file-import dialogs.

I observed a similar problem when working in Chinese (LANG="zh") but not in 
simplified Chinese (zh_CN) or Japanese (ja), so the problem isn't simply with 
non-Latin character sets. There is no problem in English, Spanish (es), or 
French (fr), and I didn't check the other languages into which the Rcmdr is 
translated.

I think that the problem originates in the Korean and Chinese translation files 
and I'll contact the translators to see whether they can fix it.

Thank you for reporting this issue.

John

> On Jan 14, 2019, at 11:36 PM, Fox, John  wrote:
> 
> Dear jihee,
> 
>> On Jan 14, 2019, at 9:00 PM, 우지희  wrote:
>> 
>> You said previously that you were using a Mac, so I'm surprised that you now 
>> say that you're using Windows. I don't have a Windows 7 system, but I can 
>> confirm that importing from Excel files works perfectly fine under Windows 
>> 10, as I just verified, and I'd be surprised if the Windows version matters. 
>> 
>> --> no, I never said i was using a Mac. 
> 
> Sorry, I guess I got that from the error message you originally reported, 
> which was "Error in structure(.External(.C_dotTclObjv, objv), class = 
> "tclObj") : [tcl] bad Macintosh file type "“*”"." I've never seen that error 
> and it seems peculiar that it would occur on a Windows system.
> 
>> 
>> You still haven't reported the versions of R, the Rcmdr package, and the 
>> other packages that you're using. The easiest way to do this is to show the 
>> output of the sessionInfo() command. 
>> 
>> --> sessionInfo()
>> R version 3.5.2 (2018-12-20)
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>> Running under: Windows 7 x64 (build 7601) Service Pack 1
>> 
>> Matrix products: default
>> 
>> locale:
>> [1] LC_COLLATE=Korean_Korea.949  LC_CTYPE=Korean_Korea.949   
>> [3] LC_MONETARY=Korean_Korea.949 LC_NUMERIC=C
>> [5] LC_TIME=Korean_Korea.949
>> 
>> attached base packages:
>> [1] tcltk splines   stats graphics  grDevices utils datasets  
>> methods  
>> [9] base 
>> 
>> other attached packages:
>> [1] RcmdrPlugin.SensoMineR_1.11-01 RcmdrPlugin.FactoMineR_1.6-0  
>> [3] Rcmdr_2.5-1effects_4.1-0 
>> [5] RcmdrMisc_2.5-1sandwich_2.5-0
>> [7] car_3.0-2  carData_3.0-2 
>> [9] SensoMineR_1.23FactoMineR_1.41   
>> 
>> loaded via a namespace (and not attached):
>> [1] gtools_3.8.1 Formula_1.2-3latticeExtra_0.6-28 
>> [4] cellranger_1.1.0 pillar_1.3.1 backports_1.1.3 
>> [7] lattice_0.20-38  digest_0.6.18RColorBrewer_1.1-2  
>> [10] checkmate_1.8.5  minqa_1.2.4  colorspace_1.3-2
>> [13] survey_3.35  htmltools_0.3.6  Matrix_1.2-15   
>> [16] plyr_1.8.4   pkgconfig_2.0.2  haven_2.0.0 
>> [19] scales_1.0.0 openxlsx_4.1.0   rio_0.5.16  
>> [22] lme4_1.1-19  htmlTable_1.13.1 tibble_1.4.2
>> [25] relimp_1.0-5 ggplot2_3.1.0nnet_7.3-12 
>> [28] lazyeval_0.2.1   survival_2.43-3  magrittr_1.5
>> [31] crayon_1.3.4 readxl_1.2.0 nlme_3.1-137
>> [34] MASS_7.3-51.1forcats_0.3.0foreign_0.8-71  
>> [37] class_7.3-14 tools_3.5.2  data.table_1.11.8   
>> [40] hms_0.4.2tcltk2_1.2-11stringr_1.3.1   
>> [43] munsell_0.5.0cluster_2.0.7-1  zip_1.0.0   
>> [46] flashClust_1.01-2compiler_3.5.2   e1071_1.7-0 
>> [49] rlang_0.3.1  grid_3.5.2   nloptr_1.2.1
>> [52] rstudioapi_0.9.0 htmlwidgets_1.3  leaps_3.0   
>> [55] base64enc_0.1-3  gtable_0.2.0 abind_1.4-5 
>> [58] curl_3.2 reshape2_1.4.3   AlgDesign_1.1-7.3   
>> [61] gridExtra_2.3zoo_1.8-4knitr_1.21  
>> [64] nortest_1.0-4Hmisc_4.1-1  KernSmooth_2.23-15  
>> [67] stringi_1.2.4Rcpp_1.0.0   rpart_4.1-13
>> [70] acepack_1.4.1scatterplot3d_0.3-41 xfun_0.4
>> 
>> This was the status that I tried to import Excel data. 
> 
> These packages seem up-to-date.
> 
>> 
>> Also, have you tried importing an Excel file in the Rcmdr *without* the two 
>> plug-in packages loaded, as I suggested in my original response?  
>> 
>> --> I tried without plug-in packages, but It didn't work. 
> 
> OK, so you tried the setup that works for me and, I assume from the lack of 
> similar error reports, for others.
> 
>> 
>> It occurs to me that the 

Re: [R] Operator Overloading in R

2019-01-16 Thread Eric Berger
I have experience with R6 classes but I have not used operator overloading
with them.
Out of curiosity I did a quick search and found this link which provides a
step by step (I am not claiming it is the only way)
https://stackoverflow.com/questions/49463235/arithmetic-operators-overload-for-r6classes-in-r

HTH,
Eric


On Wed, Jan 16, 2019 at 4:01 PM Mahnoor Malik  wrote:

> I am using R6 class and I have to do operator overloading (+ ,-,*) for a
> custom data type . What will be the necessary steps ? I am totally confused
> as to what should I do in order to implement this .
>
> Thanks
>
> [[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] Operator Overloading in R

2019-01-16 Thread Mahnoor Malik
I am using R6 class and I have to do operator overloading (+ ,-,*) for a
custom data type . What will be the necessary steps ? I am totally confused
as to what should I do in order to implement this .

Thanks

[[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-es] optimizacion costos

2019-01-16 Thread Javier Marcuzzi
Estimado Jesús Para Fernández

En teoría es ese material, lo vi muy rápido y en la parte genética tiene
cosas que biológicamente no son así, hay un libro de Falconer, Introducción
a la genética cuantitativa, que tiene escrita la parte matemática, hay un
abismo entre la biología y los ingenieros que se inspiran en la biología.

Yo pensaba en la resolución de un problema real, aunque relativamente
simple como puede ser el de mínimos costos, donde se utilice tensorflow, en
otras palabras, R tiene paquetes para la optimización, entonces me hago una
pregunta, ¿que pasa si tomo uno de esos ejemplos y lo corro con la librería
R del paquete y con Keras como documenta Rstudio utilizando tensorflow? Los
ejemplos son de reconocimiento de imágenes, regresión, clasificación, pero
¿optimización?

Javier Rubén Marcuzzi

El mié., 16 ene. 2019 a las 3:45, Jesús Para Fernández (<
j.para.fernan...@hotmail.com>) escribió:

> Buenas Javier,
>
>
> Sobre temas de optimización hay unos apuntes de la universidad de Granada
> que son realmente buenos. TE aconsejo que les eches un vistazo (basan su
> código en matlab)
>
> https://elvex.ugr.es/decsai/iaio/
>
>
> Un saludo
> Jesús
> --
> *De:* R-help-es  en nombre de Javier
> Marcuzzi 
> *Enviado:* miércoles, 16 de enero de 2019 4:14
> *Para:* r-help-es
> *Asunto:* [R-es] optimizacion costos
>
> Estimados.
>
> Hace un tiempo que tengo una duda, estaba pensando en los problemas como
> optimización de costos, donde hay varias alternativas y librerías, pasando
> por soluciones inspiradas en energía, genética o algo matemático como
> matrices y álgebra.
>
> Luego aparecen tensorflow, cntk, y otros tantos, de los cuáles
> https://keras.rstudio.com/ ofrece alternativas para mezclar los mundos por
> decirlo de alguna forma.
>
> De estos si miro https://keras.rstudio.com/ observo en la documentación lo
> que aparece siempre, la optimización. En este caso sería lo siguiente:
>
> model %>% compile
> (
>   loss = 'categorical_crossentropy',
>   optimizer = optimizer_rmsprop
> (),
>   metrics = c('accuracy')
> )
>
> Ahora mi pregunta, es posible con esos optimizadores, tomar un problema
> para producir a mínimo costo, o al contrario, para maximizar las ganancias?
>
> Alguno de ustedes vio un ejemplo al respecto? No me refiero a los muchos
> desarrollados en el R clásico, sino en R que conecta por ejemplo a
> tensorflow con keras, o en su defecto python que conecta muy simple con
> tensorflow.
>
> Con R lo resuelvo, pero me crea la duda estos optimizadores y no he
> explorado esa alternativa pero me intriga y lo intentaría de puro gusto o
> desafío personal.
>
> Agradezco comentarios.
>
> Javier Rubén Marcuzzi
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] NA rows appeared in data.frame

2019-01-16 Thread Ernest Han
Dear Rui and Petr,

Thank you for taking time and effort to help.

Rui's solution is an effective workaround so that I can continue to
work with the data. However, the appearance of these NA rows (with NA
rownames) is clearly errorneous (possibly a bug behaviour due to R
base code). What I am interested is a solution that removes these NA
rows.

The reasons is because (1) prior to the NA assignment, one does not
need to test for NA value. (2) Besides, sometimes these NA values are
needed as part of the data to indicate that the missing data.

> t1[t1$Petal.Width==1.8, "Petal.Width"] <- NA

Petr's solution is also not apt in my case, because it removes 12 rows
that have NA values in "Petal.Width". I would like a solution that
keeps the 150 rows, but not the mysterious 12 rows with all NA values
in all columns.

Once again, I appreciate your suggestions and I am hoping that this
'errorneous' behaviour has a fix.

Cheers,
Ernest

On Mon, Jan 14, 2019 at 4:25 PM PIKAL Petr  wrote:
>
> Hi
>
> If you want to remove rows with NA values from your data you could use
>
> ?complete.cases
>
> or
>
> t2 <- t1[!is.na(t1$Petal.Width),]
>
> Cheers
> Petr
>
> > -Original Message-
> > From: R-help  On Behalf Of Rui Barradas
> > Sent: Saturday, January 12, 2019 12:55 PM
> > To: Ernest Han ; r-help@r-project.org
> > Subject: Re: [R] NA rows appeared in data.frame
> >
> > Hello,
> >
> > You have to test for NA. Some (12) of the values of t1$Petal.Width are NA
> > therefore t1$Petal.Width == 2.0 alone returns 12 NA values.
> >
> > t1[t1$Petal.Width == 2.0 & !is.na(t1$Petal.Width == 2.0), ]
> >
> > Or use which(t1$Petal.Width == 2.0).
> >
> > t1[which(t1$Petal.Width == 2.0), ]
> >
> >
> > Hope this helps,
> >
> > Rui Barradas
> >
> > Às 08:23 de 12/01/2019, Ernest Han escreveu:
> > > Dear All,
> > >
> > > After replacing some values in a data.frame, NAs rows have appeared
> > > and cannot be removed. I have googled these issues and found that
> > > several people have encountered it. Solutions in stackoverflow seem to
> > > provide work-arounds but does not remove it from the data.frame.
> > > Therefore, I am turning to experts in this community for help.
> > >
> > > The code is as follows,
> > >
> > >> t1 <- iris
> > >> t1[t1$Petal.Width==1.8, "Petal.Width"] <- NA t1[t1$Petal.Width ==
> > >> 2.0, ]
> > >Sepal.Length Sepal.Width Petal.Length Petal.Width   Species
> > > NA  NA  NA   NA  NA  
> > > NA.1NA  NA   NA  NA  
> > > NA.2NA  NA   NA  NA  
> > > NA.3NA  NA   NA  NA  
> > > 1116.5 3.2  5.1   2 virginica
> > > 1145.7 2.5  5.0   2 virginica
> > > NA.4NA  NA   NA  NA  
> > > 1225.6 2.8  4.9   2 virginica
> > > 1237.7 2.8  6.7   2 virginica
> > > NA.5NA  NA   NA  NA  
> > > NA.6NA  NA   NA  NA  
> > > NA.7NA  NA   NA  NA  
> > > NA.8NA  NA   NA  NA  
> > > 1327.9 3.8  6.4   2 virginica
> > > NA.9NA  NA   NA  NA  
> > > NA.10   NA  NA   NA  NA  
> > > 1486.5 3.0  5.2   2 virginica
> > > NA.11   NA  NA   NA  NA  
> > >
> > > ## Twelve values were replaced, twelve NA rows appeared.
> > >
> > > ### MISC INFO ###
> > >> sessionInfo()
> > > R version 3.4.0 (2017-04-21)
> > > Platform: x86_64-apple-darwin16.5.0 (64-bit) Running under: macOS
> > > 10.14.2
> > >
> > > Matrix products: default
> > > BLAS:
> > > /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/
> > > vecLib.framework/Versions/A/libBLAS.dylib
> > > LAPACK:
> > > /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/
> > > vecLib.framework/Versions/A/libLAPACK.dylib
> > >
> > > locale:
> > > [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> > >
> > > attached base packages:
> > > [1] stats graphics  grDevices utils datasets  methods   base
> > >
> > > loaded via a namespace (and not attached):
> > > [1] compiler_3.4.0 tools_3.4.0
> > >> Sys.getlocale()
> > > [1] "en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"
> > >
> > >
> > > Thank you,
> > > Ernest
> > >
> > > __
> > > 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.
> > >
> >
> >