Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Rui Barradas
Hello, Inline. Às 22:44 de 29/04/20, Ana Marija escreveu: Hi Rui, thanks for getting back to me so I tried your method and I got: sum(b$PHENO==2, na.rm=T) [1] 828 sum(b$PHENO==1, na.rm=T) [1] 859 Can you please tell me if b$PHENO <- (b$FLASER == 2 | b$PLASER == 2) + 1L just assigns PHENO

Re: [R] Rtools required

2020-04-29 Thread Spencer Graves
  I just encountered something that looks exactly like that with R 4.0.0 and the latest RStudio AND with Rtools40 installed under Windows 10 (AND some manual adjustment of the path to delete references to old versions of Rtools and make sure Rtools40 was there).   I got around it by h

Re: [R] Rtools required

2020-04-29 Thread Bert Gunter
Wouldn't packages that have to be built from source on installation require Rtools? 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, Apr 29, 2020 at 6:48 PM

Re: [R] repository for ubuntu/linux mint for R 4.0.0

2020-04-29 Thread Rasmus Liland
On 2020-04-29 19:55 -0400, ProfJCNash wrote: > In updating (an older computer with) Linux Mint 18.3 I tried to add > the repository > > deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/ > > as per the "Download R for Linux" instructions. This gave an error > that there was no Releas

[R] repository for ubuntu/linux mint for R 4.0.0

2020-04-29 Thread ProfJCNash
In updating (an older computer with) Linux Mint 18.3 I tried to add the repository deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/ as per the "Download R for Linux" instructions. This gave an error that there was no Release.key file. After some investigation, I found that deb ht

Re: [R] Rtools required

2020-04-29 Thread Henrik Bengtsson
Careful so you don't overwrite an existing ~/.Renviron file; it's safer to use something like: cat('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"\n', file="~/.Renviron" append=TRUE) /Henrik On Wed, Apr 29, 2020, 15:33 Fox, John wrote: > Dear Steven, > > It's possible that Windows will hide .Ren

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Rolf Turner
On 30/04/20 12:28 am, Eric Leroy wrote: Dear all, I am sorry to see all the reactions I provoked from a newbie user. Anyway, thank you for the answer I think that the pcf3est function responds to my question. Indeed the spatstat is a very impressive library and I am very grateful to the the d

Re: [R] Rtools required

2020-04-29 Thread Fox, John
Dear Steven, It's possible that Windows will hide .Renviron, but it's generally a good idea, in my opinion, in Folder Options > View to click "Show hidden files" and uncheck "hide extensions". Then .Renviron should show up (once you've created it). Best, John > -Original Message- > F

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
Thank you so much, numbers add up now! On Wed, Apr 29, 2020 at 5:09 PM wrote: > > While I've sent you a maths way to do it, > > I'd probably take this approach; > > # set b$pheno to 1 as default > > b$pheno <- 1 > > # set the flaser > > b$pheno[b$flaser == 2] <- 2 > > #set the plaser > > b$pheno[

Re: [R] Designing a Fractional Factorial Design in R

2020-04-29 Thread Bert Gunter
https://CRAN.R-project.org/view=ExperimentalDesign For many R experimental design packages. You might wish to bookmark the CRAN task view page. 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 "

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
Hi Rui, thanks for getting back to me so I tried your method and I got: > sum(b$PHENO==2, na.rm=T) [1] 828 > sum(b$PHENO==1, na.rm=T) [1] 859 Can you please tell me if b$PHENO <- (b$FLASER == 2 | b$PLASER == 2) + 1L just assigns PHENO=2 if b$FLASER == 2 | b$PLASER == 2 and everything else is 1?

Re: [R] Rtools required

2020-04-29 Thread Bert Gunter
Type ?.Renviron ?R.home ?"environment variables" at the R prompt to get what I think should be the info you need (or at least useful info). 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 "Blo

Re: [R] [FORGED] what is the expected behavior of layout.show(n)

2020-04-29 Thread Yousri Fanous
Thank you Yousri On Wed, Apr 29, 2020 at 5:12 PM Paul Murrell wrote: > Hi > > This behaviour is as expected. > > The layout.show() function is just there to help visualise what the > layout will look like. > > So for testing purposes, you would do something like ... > > layout(...) > layout.sho

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ege Rubak
Or if you prefer not to load an entire suite of packages to do such a simple task you could use b$PHENO <- ifelse(...) or in this specific case it seems sufficient to do b$PHENO <- pmax(b$FLASER, b$PLASER) /Ege On Wed, 2020-04-29 at 15:30 -0400, Patrick (Malone Quantitative) wrote: > If you do

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Ege Rubak
Hi Abby, Once again I must say your form of communication puzzles me. Do you believe it benefits the open source community to communicate like this? What about contacting the package maintainer in this way: "Hi, I was helping someone else using your package to estimate a pair correlation function

[R] Designing a Fractional Factorial Design in R

2020-04-29 Thread Rahul Chakraborty
Dear all, Presently I am working on designing a questionnaire for my discrete choice experiment. I intend to use R for the "fractional factorial design". I have the following objective- The respondent has to choose one out of 4 objects. Each of the 4 objects are classified by 5 different attribut

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Ege Rubak
Dear all, I see two issues here: 1. A new user has a hard time finding and using a specific function in spatstat. As package authors we are always interested in such reports and we then try to improve documentation, which is indeed a very important part of any software project. The package is **v

Re: [R] Rtools required

2020-04-29 Thread Steven Yen
Thanks. Can you kindly tell me what to read to do it the "standard way"? Also, where can I find file .Renviron. On 2020/4/28 下午 11:08, Duncan Murdoch wrote: On 28/04/2020 11:02 a.m., Steven Yen wrote: In RStudio, I enter File -> Open Project -> and browse to open a .Rproj file. Then, I click B

Re: [R] Rtools required

2020-04-29 Thread Steven Yen
In RStudio, I enter File -> Open Project -> and browse to open a .Rproj file. Then, I click Build -> Build Binary Package. Thanks. On 2020/4/28 下午 10:55, Duncan Murdoch wrote: On 28/04/2020 9:56 a.m., Steven Yen wrote: Thanks. I visited the Rtools web page and learned to run the following line

Re: [R] Rtools required

2020-04-29 Thread Steven Yen
Thanks. Updating RStudio to 1.2.5042 did fix the problem. Thank you! On 2020/4/28 下午 11:30, Duncan Murdoch wrote: On 28/04/2020 11:16 a.m., Steven Yen wrote: Thanks. Can you kindly tell me what to read to do it the "standard way"? Start with ?INSTALL, and find more details in the Writing R Ex

Re: [R] Rtools required

2020-04-29 Thread Steven
Hello John, Perhaps you can help me. I am an idiot. I visited the Rtools web page and learn to run the following lines in R: Still I am getting the same warning message. > writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron") > Sys.which("make")   

Re: [R] Rtools required

2020-04-29 Thread Steven
Thanks John. Where is file .Renviron located? It must be a hidden file. I cannot find it. On 2020/4/28 下午 08:29, Fox, John wrote: Dear Steven, Did you follow the instruction on the Rtools webpage to add PATH="${RTOOLS40_HOME}\usr\bin;${PATH}" to your .Renviron file? I hope this help

Re: [R] Rtools required

2020-04-29 Thread Steven Yen
Thanks. I visited the Rtools web page and learned to run the following lines. I am still getting the same warning message. > writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron") > Sys.which("make")   make "C:\\rtools40\\usr\\bin\\make.exe" O

Re: [R] [FORGED] what is the expected behavior of layout.show(n)

2020-04-29 Thread Paul Murrell
Hi This behaviour is as expected. The layout.show() function is just there to help visualise what the layout will look like. So for testing purposes, you would do something like ... layout(...) layout.show(n) Then to actually use the layout, you would do something like ... layout(...) plot

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Rui Barradas
Hello, Here is another way. The condition returns FALSE/TRUE or 0/1. Add 1 to get the expected result. It has the advantage of being faster. b$PHENO <- (b$FLASER == 2 | b$PLASER == 2) + 1L Hope this helps, Rui Barradas Às 20:42 de 29/04/20, Ana Marija escreveu: Thanks, I did this: b$PHENO

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Abby Spurdle
> suggests that the package isn't fit for CRAN, which I consider a > direct insult to Adrian and all the hard work he has done This is my last post on this subject. I just ran R check on the source package. After 40 minutes, R check wasn't complete. And I note the CRAN check results show the pac

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
Thanks, I did this: b$PHENO<- ifelse(b$FLASER ==2 | b$PLASER ==2, 2, 1) On Wed, Apr 29, 2020 at 2:36 PM Ivan Krylov wrote: > > On Wed, 29 Apr 2020 14:19:18 -0500 > Ana Marija wrote: > > > My conditions for creating a new column PHENO would be this: > > > > if FLASER or PLASER =2 then PHENO=2 > >

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Ivan Krylov
On Wed, 29 Apr 2020 14:19:18 -0500 Ana Marija wrote: > My conditions for creating a new column PHENO would be this: > > if FLASER or PLASER =2 then PHENO=2 > otherwise PHENO=1 On Wed, 29 Apr 2020 15:30:45 -0400 "Patrick (Malone Quantitative)" wrote: > If you don't mind using tidyverse, you ca

Re: [R] how to create a new column from two columns with conditions

2020-04-29 Thread Patrick (Malone Quantitative)
If you don't mind using tidyverse, you can do this easily with if_else. b$PHENO<-if_else(... On Wed, Apr 29, 2020 at 3:21 PM Ana Marija wrote: > Hello, > > I have a data frame like this: > > > head(b) >FID IID FLASER PLASER > 1: fam1000 G1000 1 1 > 2: fam1001 G1001

[R] how to create a new column from two columns with conditions

2020-04-29 Thread Ana Marija
Hello, I have a data frame like this: > head(b) FID IID FLASER PLASER 1: fam1000 G1000 1 1 2: fam1001 G1001 1 1 3: fam1003 G1003 1 2 4: fam1005 G1005 1 1 5: fam1009 G1009 2 1 6: fam1052 G1052 1 1 ... My conditions for cr

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Abby Spurdle
NOTE CITATIONS USE BRIEF EXCERPTS > It's a complaint that no-one responded to your query within 24 hours. Correction, it wasn't my query. I was replying to someone else's query. > Finally, you cast doubt on whether the function pcf3est actually does > calculate... You've taken what I said out

Re: [R] upgrade from R 3.6.3 to 4.0.0

2020-04-29 Thread J C Nash
Did you update your software sources (/etc/apt/sources.list or entry in /etc/apt/sources.list.d)? JN On 2020-04-29 1:01 p.m., Carlos H. Mireles wrote: > Hello everyone, I'm trying to upgrade R from 3.6.3 to 4.0.0 using the linux > terminal commands (sudo apt upgrade r-base r-base-dev) but I get

[R] upgrade from R 3.6.3 to 4.0.0

2020-04-29 Thread Carlos H. Mireles
Hello everyone, I'm trying to upgrade R from 3.6.3 to 4.0.0 using the linux terminal commands (sudo apt upgrade r-base r-base-dev) but I get a message that says 3.6.3 is still the latest version. Please see the output below. How could I fix this? Thanks much for your help! Carlos ===

Re: [R] regular expression, stringr::str_view, grep

2020-04-29 Thread Andy Spada
This highlights the literal meaning of the last ] in your correct_brackets: aff <- c("affgfk]ing", "fgok", "rafgkah]e","a fgk", "bafghk]") To me, too, the missing_brackets looks more like what was desired, and returns correct results for a PCRE. Perhaps the regular expression should have been re

Re: [R] R-help Digest, Vol 206, Issue 25

2020-04-29 Thread David Duffy
I don't think anyone responded last week. > Using the mice package, I have created multiple imputed datasets to deal > with missing data. I am looking for an example of the R code to use in > order to analyze the set of imputed datasets using tetrachoric correlations > in such a way that after poo

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Adrian Baddeley
I am the main author of spatstat, and the author of the code and documentation for pcf3est. This is the first time in 25 years that I can remember anyone complaining about the documentation for the spatstat package. The available documentation for spatstat includes: - welcome

Re: [R] How can I solve an error after installing RStudio

2020-04-29 Thread Jeff Newmiller
Ah, no, this mailing list is about R, not RStudio. It is _possible_ that your problem could be with R because RStudio requires that R be installed, but you would need to explain how an error appears when you use RGui or R (from the command line) to separate any RStudio issues from R issues. If t

[R] Fwd: How can I solve an error after installing RStudio

2020-04-29 Thread Bert Gunter
Neglected to cc. R-help -- Forwarded message - From: Bert Gunter Date: Wed, Apr 29, 2020 at 7:40 AM Subject: Re: [R] How can I solve an error after installing RStudio To: Vahid Borji No. You have to go to the RStudio website/help pages. RStudio is separate software from R. Be

[R] How can I solve an error after installing RStudio

2020-04-29 Thread Vahid Borji
Hi there, I downloaded Rstudio and installed it on my laptop. When I want to open Rstudio I see the below message: The program can't start because api-ms-win-runtime-|1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem. Could you please help me how I can solv

[R] what is the expected behavior of layout.show(n)

2020-04-29 Thread Yousri Fanous
Hello Load package: ACSWR > data(sample) > layout(matrix(c(1,1,2,2,3,3,0,4,4,5,5,0),2,6,byrow=T),respect=F) > hist(sample[,1],main="Hist for sample I",xlab="sample 1",ylab="freq") > hist(sample[,2],main="Hist for sample II",xlab="sample 2",ylab="freq") > hist(sample[,3],main="Hist for sample III",

Re: [R] Package 'coin' - How to extract rho

2020-04-29 Thread Achim Zeileis
On Wed, 29 Apr 2020, Blume Christine wrote: Dear Achim, Many thanks indeed. Yes, I had thought about this too and, fortunately, the bootstrapping confirms the results from the "normal" test. However, I was wondering whether it is mathematically acceptable to report the pvals from bootstrappi

Re: [R] Package 'coin' - How to extract rho

2020-04-29 Thread Blume Christine
Dear Achim, Many thanks indeed. Yes, I had thought about this too and, fortunately, the bootstrapping confirms the results from the "normal" test. However, I was wondering whether it is mathematically acceptable to report the pvals from bootstrapping, but non-bootstrapped correlation coefficien

Re: [R] [FORGED] Re: pair correlation function of 3D points

2020-04-29 Thread Eric Leroy
Dear all, I am sorry to see all the reactions I provoked from a newbie user. Anyway, thank you for the answer I think that the pcf3est function responds to my question. Indeed the spatstat is a very impressive library and I am very grateful to the the developers. Best regards Eric LEROY Res

Re: [R] Package 'coin' - How to extract rho

2020-04-29 Thread Achim Zeileis
Christine, thanks for the example. As far as I can see, the "coin" package does not explicitly compute Spearman's rho. This is probably also the reason why it isn't reported in the test output. Thus, you would have to do this "by hand" using cor(..., method = "spearman"). Hope that helps, Ac

Re: [R] Package 'coin' - How to extract rho

2020-04-29 Thread Blume Christine
Dear Jim, Many thanks for following up on this. Sure, I can provide a sample code. At the end of the code you see that I extract the p-value and the test statistic. However, I cannot find the correlation coefficient rho anywhere in the object “r”. Best, Christine if(!require(pacman)) i