[R] how to change manhattan plot code to get a different color per chromosome

2020-06-15 Thread Ana Marija
Hello,

Is there is a way to set colors in this plot to look like this one in
attach (different color for each CHR-there is 22 of them)?


library(qqman)
results_log <- read.table("meta_p_pos_chr.F", head=TRUE,stringsAsFactors=FALSE)
png("META.png")
manhattan(results_log,chr="CHR",bp="POS",p="META_pval",snp="MARKER",ylim
= c(0, 10))
dev.off()

Thanks
Ana
__
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] Convergence in Monte Carlo Simulation

2020-06-15 Thread Phat Chau
Dear Michael, 

So I shouldn't be setting the seed at all then since it is automatic? Or is the 
suggestion here that a new seed is chosen each time?

I think rather than having you guess at the problem (my apologies) I will post 
the entire of the code (with omissions where it is not directly impacting the 
problem at hand). Sometimes I hesitate to post huge blocks because it can be a 
bit daunting, but I realize in coding that even the smallest glitch can throw 
everything off.

Set.seed(123) << wrote:

Dear Edward

Every time you call your function powercrosssw() it resets the seed so 
you must be calling it multiple times in some way.

Michael

On 14/06/2020 13:57, Phat Chau wrote:
> Thank you Michael.
> 
> I will clarify some more. The function in the first part of the code that 
I posted generates the simulated dataset for a cluster randomized trial from 
the simstudy package.
> 
> I am not quite clear what you mean by placing it outside the loop. So the 
goal here is to create n = 1000 independent datasets with different (randomly 
drawn values from the specified normal distributions not shown) for all of the 
parameters. What I have tried to do is place the seed at the very top of all my 
code in the past, but what that does is it leads to the creation of a single 
dataset that gets repeated over and over n = 1000 times. Hence, there ends up 
being no variability in the data (and power estimates from the p-values given 
the stated and required power).
> 
> Regarding the counter, is it correct in this instance that the loop will 
continue until n = 1000 iterations have successfully converged? I am not so 
concerned with counting failures.
> 
> Thank you.
> Edward
> 
> On 2020-06-14, 6:46 AM, "Michael Dewey"  wrote:
> 
>  I am not 100% clear what your code is doing as it gets a bit wangled 
as
>  you posted in HTML but here are a couple of thoughts.
>  
>  You need to set the seed outside any loops so it happens once and 
for all.
>  
>  I would test after trycatch and keep a separate count of failures and
>  successes as the failure to converge must be meaningful about the
>  scientific question whatever that is. At the moment your count 
appears
>  to be in the correct place to count successes.
>  
>  Michael
>  
>  On 14/06/2020 02:50, Phat Chau wrote:
>  > Hello,
>  >
>  > I put together the following code and am curious about its 
correctness. My first question relates to the Monte Carlo simulations – the 
goal is to continue to iterate until I get n = 1000 simulations where the model 
successfully converges. I am wondering if I coded it correctly below with the 
while loop. Is the idea that the counter increments by one only if “model” does 
not return a string?
>  >
>  > I would also like to know how I can create n = 1000 independent 
data sets. I think to do this, I would have to set a random number seed via 
set.seed() before the creation of each dataset. Where would I enter set.seed in 
the syntax below? Would it be in the function (as indicated in red)?
>  >
>  > powercrosssw <- function(nclus, clsize) {
>  >
>  >set.seed()
>  >
>  >cohortsw <- genData(nclus, id = "cluster")
>  >cohortsw <- addColumns(clusterDef, cohortsw)
>  >cohortswTm <- addPeriods(cohortsw, nPeriods = 8, idvars = 
"cluster", perName = "period")
>  >cohortstep <- trtStepWedge(cohortswTm, "cluster", nWaves = 4, 
lenWaves = 1, startPer = 1, grpName = "Ijt")
>  >
>  >pat <- genCluster(cohortswTm, cLevelVar = "timeID", numIndsVar 
= clsize, level1ID = "id")
>  >
>  >dx <- merge(pat[, .(cluster, period, id)], cohortstep, by = 
c("cluster", "period"))
>  >dx <- addColumns(patError, dx)
>  >
>  >setkey(dx, id, cluster, period)
>  >
>  >dx <- addColumns(outDef, dx)
>  >
>  >return(dx)
>  >
>  > }
>  >
>  > i=1
>  >
>  > while (i < 1000) {
>  >
>  >dx <- powercrosssw()
>  >
>  >#Fit multi-level model to simulated dataset
>  >model5 <- tryCatch(lme(y ~ factor(period) + factor(Ijt), data = 
dx, random = ~1|cluster, method = "REML"),
>  >   warning = function(w) { "warning" }
>  >)
>  >
>  >if (! is.character(model5)) {
>  >
>  >  coeff <- coef(summary(model5))["factor(Ijt)1", "Value"]
>  >  pvalue <- coef(summary(model5))["factor(Ijt)1", "p-value"]
>  >  error <- coef(summary(model5))["factor(Ijt)1", "Std.Error"]
>  >  bresult <- c(bresult, coeff)
>  >  presult <- c(presult, pvalue)

Re: [R] Rstudio does not run on ubuntu 20

2020-06-15 Thread Luigi Marongiu
Ok I will use another blog. Thank you

On Mon, Jun 15, 2020 at 4:03 PM Dirk Eddelbuettel  wrote:
>
>
> On 15 June 2020 at 14:46, Luigi Marongiu wrote:
> | Hello,
> | all of a sudden rstudio stopped working on ubuntu 20.04. I
> | re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
> | even if there is an icon. On terminal I got:
> | ```
> | $ rstudio
> | rstudio: error while loading shared libraries: libssl.so.1.0.0: cannot
> | open shared object file: No such file or directory
> | $ sudo apt-get install libssl1.0.0 libssl-dev
> | Reading package lists... Done
> | Building dependency tree
> | Reading state information... Done
> | Package libssl1.0.0 is not available, but is referred to by another package.
> | This may mean that the package is missing, has been obsoleted, or
> | is only available from another source
> |
> | E: Package 'libssl1.0.0' has no installation candidate
> |
> | ```
> | On internet, it is said that this library was discontinued
> | (https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
> | R is up and running instead:
> | ```
> | $ R
> | R version 4.0.1 (2020-06-06) -- "See Things Now"
> | Copyright (C) 2020 The R Foundation for Statistical Computing
> | Platform: x86_64-pc-linux-gnu (64-bit)
> |
> | ```
> | How can I launch studio then?
>
> You appear to have asked the wrong part of the internet. If you go to
>
>   packages.ubuntu.com
>
> and search for 'libssl1.0.0', selecting "all" distributions, and "search
> package name", you get the page
>
>   
> https://packages.ubuntu.com/search?keywords=libssl1.0.0&searchon=names&suite=all§ion=all
>
> suggesting downloads of the package from two LTS releases (and two updates
> within). Download the file eg
>
>   cd /tmp
>   wget 
> http://mirrors.kernel.org/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
>   sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
>
> Lastly, you asked _on the wrong mailing list_. Questions for R use on Debian
> or Ubuntu (or derived) systems should got to r-sig-debian instead. It is a
> friendly place.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org



-- 
Best regards,
Luigi

__
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] Rstudio does not run on ubuntu 20

2020-06-15 Thread Dirk Eddelbuettel


On 15 June 2020 at 14:46, Luigi Marongiu wrote:
| Hello,
| all of a sudden rstudio stopped working on ubuntu 20.04. I
| re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
| even if there is an icon. On terminal I got:
| ```
| $ rstudio
| rstudio: error while loading shared libraries: libssl.so.1.0.0: cannot
| open shared object file: No such file or directory
| $ sudo apt-get install libssl1.0.0 libssl-dev
| Reading package lists... Done
| Building dependency tree
| Reading state information... Done
| Package libssl1.0.0 is not available, but is referred to by another package.
| This may mean that the package is missing, has been obsoleted, or
| is only available from another source
| 
| E: Package 'libssl1.0.0' has no installation candidate
| 
| ```
| On internet, it is said that this library was discontinued
| (https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
| R is up and running instead:
| ```
| $ R
| R version 4.0.1 (2020-06-06) -- "See Things Now"
| Copyright (C) 2020 The R Foundation for Statistical Computing
| Platform: x86_64-pc-linux-gnu (64-bit)
| 
| ```
| How can I launch studio then?

You appear to have asked the wrong part of the internet. If you go to

  packages.ubuntu.com

and search for 'libssl1.0.0', selecting "all" distributions, and "search
package name", you get the page

  
https://packages.ubuntu.com/search?keywords=libssl1.0.0&searchon=names&suite=all§ion=all

suggesting downloads of the package from two LTS releases (and two updates
within). Download the file eg

  cd /tmp
  wget 
http://mirrors.kernel.org/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
  sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb

Lastly, you asked _on the wrong mailing list_. Questions for R use on Debian
or Ubuntu (or derived) systems should got to r-sig-debian instead. It is a
friendly place.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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] if else statement adjustemtn

2020-06-15 Thread Ana Marija
HI Jim

thank you so much! This is amazing answer!!!

Ana

On Sat, Jun 13, 2020 at 4:09 AM Jim Lemon  wrote:
>
> Right, back from shopping. Since you have fourteen rows containing NAs
> and you only want seven, we can infer that half of them must go. As
> they are neatly divided into seven rows in which only one NA appears
> and seven in which two stare meaninglessly out at us. I will assume
> that the latter are the ones to be discarded. As your condition for
> calculating "pheno" stated that a 2 in either FLASER or PLASER should
> result in a 2 in pheno, the following statement closely conforms to
> that:
>
> b<-read.table(text="FID   IID FLASER PLASER
>   fam1837 G1837  1 NA
>   fam2410 G2410 NA NA
>   fam2838 G2838 NA  2
>   fam3367 G3367  1 NA
>   fam3410 G3410  1 NA
>   fam3492 G3492  1 NA
>   fam0911  G911 NA NA
>   fam3834 G3834  2 NA
>   fam4708 G4708 NA  2
>   fam5162 G5162 NA NA
>   fam5274 G5274 NA NA
>   fam0637  G637 NA NA
>   fam0640  G640 NA NA
>   fam0743  G743 NA NA
>   fam0911  G911 NA NA",
>   header=TRUE,stringsAsFactors=FALSE)
>
> b$pheno<-ifelse(b$FLASER == 2 | b$PLASER == 2,2,1)
> # use the valid FLASER values when PLASER is NA
> b[is.na(b$pheno),]$pheno<-ifelse(!is.na(b[is.na(b$pheno),]$FLASER),
>  b[is.na(b$pheno),]$FLASER,NA)
> # use the valid PLASER values when FLASER if NA
> b[is.na(b$pheno),]$pheno<-ifelse(!is.na(b[is.na(b$pheno),]$PLASER),
>  b[is.na(b$pheno),]$PLASER,NA)
> b
>
> I could write that mess in one straitjacket of conditional statements
> but my brain hurts enough.
>
> Jim
>
>
> On Sat, Jun 13, 2020 at 1:59 PM Ana Marija  
> wrote:
> >
> > Great idea!
> > Here it is:
> > > b[is.na(b$FLASER) | is.na(b$PLASER),]
> > FID   IID FLASER PLASER pheno
> >  1: fam1837 G1837  1 NA 2
> >  2: fam2410 G2410 NA NA 2
> >  3: fam2838 G2838 NA  2 2
> >  4: fam3367 G3367  1 NA 2
> >  5: fam3410 G3410  1 NA 2
> >  6: fam3492 G3492  1 NA 2
> >  7: fam3834 G3834  2 NA 2
> >  8: fam4708 G4708 NA  2 2
> >  9: fam5162 G5162 NA NA 2
> > 10: fam5274 G5274 NA NA 2
> > 11: fam0637  G637 NA NA 2
> > 12: fam0640  G640 NA NA 2
> > 13: fam0743  G743 NA NA 2
> > 14: fam0911  G911 NA NA 2
> >
> > On Fri, Jun 12, 2020 at 10:29 PM Jim Lemon  wrote:
> > >
> > > Since you have only a few troublesome NA values, if you look at them,
> > > or even better, post them:
> > >
> > > b[is.na(b$FLASER) | is.na(b$PLASER),]
> > >
> > > perhaps we can work out the appropriate logic to get rid of only the
> > > ones you don't want.
> > >
> > > Jim
> > >
> > > On Sat, Jun 13, 2020 at 12:50 PM Ana Marija  
> > > wrote:
> > > >
> > > > Hi Rasmus,
> > > >
> > > > thank you for getting back to be, the command your provided seems to
> > > > add all 11 NAs to 2s
> > > > > b$pheno <-
> > > > +   ifelse(b$PLASER==2 |
> > > > +  b$FLASER==2 |
> > > > +  is.na(b$PLASER) |
> > > > +  is.na(b$PLASER) & b$FLASER %in% 1:2 |
> > > > +  is.na(b$FLASER) & b$PLASER == 2,
> > > > +  2, 1)
> > > > > table(b$pheno, exclude = NULL)
> > > >
> > > >   1   2
> > > > 859 839
> > > >
> > > > Once again my desired results is to keep these 7 NAs as NAs
> > > > > table(b$PLASER,b$FLASER, exclude = NULL)
> > > >
> > > >  1   2   3 
> > > >   1836  14   00
> > > >   2691  70  432
> > > >   3  2   7  210
> > > >  4   1   07
> > > >
> > > > and have
> > > > 825 2s (825=691+14+70+7+43)
> > > > and the rest would be 1s (866=1698-7-825)
> > > >
> > > > On Fri, Jun 12, 2020 at 9:29 PM Rasmus Liland  wrote:
> > > > >
> > > > > On 2020-06-13 11:30 +1000, Jim Lemon wrote:
> > > > > > On Fri, Jun 12, 2020 at 8:06 PM Jim Lemon wrote:
> > > > > > > On Sat, Jun 13, 2020 at 10:46 AM Ana Marija wrote:
> > > > > > > >
> > > > > > > > I am trying to make a new column
> > > > > > > > "pheno" so that I reduce the number
> > > > > > > > of NAs
> > > > > > >
> > > > > > > it looks like those two NA values in
> > > > > > > PLASER are the ones you want to drop.
> > > > > >
> > > > > > From just your summary table, it's hard to
> > > > > > guess the distribution of NA values.
> > > > >
> > > > > Dear Ana,
> > > > >
> > > > > This small sample
> > > > >
> > > > > b <- read.table(text="FLASER;PLASER
> > > > > 1;2
> > > > > ;2
> > > > > ;
> > > > > 1;
> > > > > 2;
> > > > > 2;2
> > > > > 3;2
> > > > > 3;3
> > > > > 1;1", sep=";", header=TRUE)
> > > > >
> > > > > table(b$PLASER,b$FLASER, exclude = NULL)
> > > > >
> > > > > yields the same combinations you showed
> > > > > earlier:
> > > > >
> > > > >1 2 3 
> > > > >   11 0 00
> > > >

Re: [R] Rstudio does not run on ubuntu 20

2020-06-15 Thread Thierry Onkelinx via R-help
Dear Luigi,

This is rather an RStudio problem than an R problem. I suggest contacting
RStudio or their community help forum at https://community.rstudio.com/

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkel...@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///




Op ma 15 jun. 2020 om 14:47 schreef Luigi Marongiu :

> Hello,
> all of a sudden rstudio stopped working on ubuntu 20.04. I
> re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
> even if there is an icon. On terminal I got:
> ```
> $ rstudio
> rstudio: error while loading shared libraries: libssl.so.1.0.0: cannot
> open shared object file: No such file or directory
> $ sudo apt-get install libssl1.0.0 libssl-dev
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Package libssl1.0.0 is not available, but is referred to by another
> package.
> This may mean that the package is missing, has been obsoleted, or
> is only available from another source
>
> E: Package 'libssl1.0.0' has no installation candidate
>
> ```
> On internet, it is said that this library was discontinued
> (https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
> R is up and running instead:
> ```
> $ R
> R version 4.0.1 (2020-06-06) -- "See Things Now"
> Copyright (C) 2020 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> ```
> How can I launch studio then?
> --
> Best regards,
> Luigi
>
> __
> 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] Fortune nomination!

2020-06-15 Thread J C Nash



On 2020-06-15 9:26 a.m., Martin Maechler wrote:
> It allows you to smell the true original fresh air if you
> want instead of having to breathe continuously being wrapped
> inside  sugar candy.

__
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] Rstudio does not run on ubuntu 20

2020-06-15 Thread Luigi Marongiu
ok so I'll redirect to Rstudio...
Thanks

On Mon, Jun 15, 2020 at 3:26 PM Martin Maechler 
wrote:

> > Luigi Marongiu
> > on Mon, 15 Jun 2020 14:46:38 +0200 writes:
>
> > Hello,
> > all of a sudden rstudio stopped working on ubuntu 20.04. I
> > re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
> > even if there is an icon. On terminal I got:
> > ```
> > $ rstudio
> > rstudio: error while loading shared libraries: libssl.so.1.0.0:
> cannot
> > open shared object file: No such file or directory
> > $ sudo apt-get install libssl1.0.0 libssl-dev
> > Reading package lists... Done
> > Building dependency tree
> > Reading state information... Done
> > Package libssl1.0.0 is not available, but is referred to by another
> package.
> > This may mean that the package is missing, has been obsoleted, or
> > is only available from another source
>
> > E: Package 'libssl1.0.0' has no installation candidate
>
> > ```
> > On internet, it is said that this library was discontinued
> > (https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
> > R is up and running instead:
> > ```
> > $ R
> > R version 4.0.1 (2020-06-06) -- "See Things Now"
> > Copyright (C) 2020 The R Foundation for Statistical Computing
> > Platform: x86_64-pc-linux-gnu (64-bit)
>
> > ```
> > How can I launch studio then?
>
> you don't.  Use R ! ..
>
> Well, I'm mostly joking.  Personally, I do use Rstudio very
> rarely (but R daily, 85% of my work time), but then I'm a
> co-author of ESS (Emacs Speaks Statistics) and have been an
> emacs lover since ~1988 ..
>
> It's good, Luigi, we (all R-help readers) now know about the problem.
> But this mailing list is about R (and the R project). Rstudio is
> a company and a product has their own support list.
> Though I'm sure they will get the message from here or otherwise
> anyway.
>
> Do keep using Linux, it's well worth the occasional small
> pain.  It allows you to smell the true original fresh air if you
> want instead of having to breathe continuously being wrapped
> inside  sugar candy.
> At home and at work, I have no computer but those running Linux
> (even though I'm occasionally glad to have access to a Windows
>  terminal server at work, not the least to test R and packages,
>  almost always using ESS also there)!
>
> Best wishes,
> Martin
>
> --
> Martinhttp://stat.ethz.ch/~maechler
> Seminar für Statistik, ETH Zürich HG G 16   Rämistrasse 101
> CH-8092 Zurich, SWITZERLAND   ☎ +41 44 632 3408<><
>


-- 
Best regards,
Luigi

[[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] Rstudio does not run on ubuntu 20

2020-06-15 Thread Martin Maechler
> Luigi Marongiu 
> on Mon, 15 Jun 2020 14:46:38 +0200 writes:

> Hello,
> all of a sudden rstudio stopped working on ubuntu 20.04. I
> re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
> even if there is an icon. On terminal I got:
> ```
> $ rstudio
> rstudio: error while loading shared libraries: libssl.so.1.0.0: cannot
> open shared object file: No such file or directory
> $ sudo apt-get install libssl1.0.0 libssl-dev
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Package libssl1.0.0 is not available, but is referred to by another 
package.
> This may mean that the package is missing, has been obsoleted, or
> is only available from another source

> E: Package 'libssl1.0.0' has no installation candidate

> ```
> On internet, it is said that this library was discontinued
> (https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
> R is up and running instead:
> ```
> $ R
> R version 4.0.1 (2020-06-06) -- "See Things Now"
> Copyright (C) 2020 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)

> ```
> How can I launch studio then?

you don't.  Use R ! ..

Well, I'm mostly joking.  Personally, I do use Rstudio very
rarely (but R daily, 85% of my work time), but then I'm a
co-author of ESS (Emacs Speaks Statistics) and have been an
emacs lover since ~1988 ..

It's good, Luigi, we (all R-help readers) now know about the problem.
But this mailing list is about R (and the R project). Rstudio is
a company and a product has their own support list.
Though I'm sure they will get the message from here or otherwise
anyway.

Do keep using Linux, it's well worth the occasional small
pain.  It allows you to smell the true original fresh air if you
want instead of having to breathe continuously being wrapped
inside  sugar candy.
At home and at work, I have no computer but those running Linux
(even though I'm occasionally glad to have access to a Windows
 terminal server at work, not the least to test R and packages,
 almost always using ESS also there)!

Best wishes,
Martin

--
Martinhttp://stat.ethz.ch/~maechler
Seminar für Statistik, ETH Zürich HG G 16   Rämistrasse 101
CH-8092 Zurich, SWITZERLAND   ☎ +41 44 632 3408<><

__
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] Rstudio does not run on ubuntu 20

2020-06-15 Thread Luigi Marongiu
Hello,
all of a sudden rstudio stopped working on ubuntu 20.04. I
re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
even if there is an icon. On terminal I got:
```
$ rstudio
rstudio: error while loading shared libraries: libssl.so.1.0.0: cannot
open shared object file: No such file or directory
$ sudo apt-get install libssl1.0.0 libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libssl1.0.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libssl1.0.0' has no installation candidate

```
On internet, it is said that this library was discontinued
(https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
R is up and running instead:
```
$ R
R version 4.0.1 (2020-06-06) -- "See Things Now"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

```
How can I launch studio then?
-- 
Best regards,
Luigi

__
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] if else statement adjustemtn

2020-06-15 Thread Rasmus Liland
On 2020-06-13 19:09 +1000, Jim Lemon wrote:
> Right, back from shopping. Since you have fourteen rows containing NAs
> and you only want seven, we can infer that half of them must go. As
> they are neatly divided into seven rows in which only one NA appears
> and seven in which two stare meaninglessly out at us. I will assume
> that the latter are the ones to be discarded. As your condition for
> calculating "pheno" stated that a 2 in either FLASER or PLASER should
> result in a 2 in pheno, the following statement closely conforms to
> that:
> 
> b<-read.table(text="FID   IID FLASER PLASER
>   fam1837 G1837  1 NA
>   fam2410 G2410 NA NA
>   fam2838 G2838 NA  2
>   fam3367 G3367  1 NA
>   fam3410 G3410  1 NA
>   fam3492 G3492  1 NA
>   fam0911  G911 NA NA
>   fam3834 G3834  2 NA
>   fam4708 G4708 NA  2
>   fam5162 G5162 NA NA
>   fam5274 G5274 NA NA
>   fam0637  G637 NA NA
>   fam0640  G640 NA NA
>   fam0743  G743 NA NA
>   fam0911  G911 NA NA",
>   header=TRUE,stringsAsFactors=FALSE)
> 
> b$pheno<-ifelse(b$FLASER == 2 | b$PLASER == 2,2,1)
> # use the valid FLASER values when PLASER is NA
> b[is.na(b$pheno),]$pheno<-ifelse(!is.na(b[is.na(b$pheno),]$FLASER),
>  b[is.na(b$pheno),]$FLASER,NA)
> # use the valid PLASER values when FLASER if NA
> b[is.na(b$pheno),]$pheno<-ifelse(!is.na(b[is.na(b$pheno),]$PLASER),
>  b[is.na(b$pheno),]$PLASER,NA)
> b
> 
> I could write that mess in one straitjacket of conditional statements
> but my brain hurts enough.

I think this answer is billiant!

Here's a picture of my laptop screen out in my local park 
yesterday as I was trying to figure this out

https://mega.nz/#!OERQFSgL!McUkMYwkrcQXN148Wr11K1xRHSTOWVFfz4gRwaZYLzM

I have nothing more to add at the moment :)

/Rasmus


signature.asc
Description: PGP signature
__
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.