Re: [R] NA command in a 'for' loop

2020-04-19 Thread Rui Barradas
Hello, Instead of d[d == 0] <- NA try d[] <- lapply(d, function(x) {is.na(x) <- x == 0; x}) Also, in the first for loop paste(i, sep = "") does nothing, it's the same as i. And the same for (d2$V4 == 1) == TRUE Since (d2$V4 == 1) already is FALSE/TRUE there is no need for (.) == TRUE

Re: [R] how to create a sorted barplot and colored by groups

2020-04-19 Thread Jim Lemon
Hi aiguo, I assume that the data in your request was a text file that you want to read in. You can do it like this if you make a few changes as in the attached "aiguo_example.txt". Here is some code that may be helpful: # let the pipes be read in as fields, then index them out aiguo.df<-read.table

Re: [R] how to create a sorted barplot and colored by groups

2020-04-19 Thread John Kane
"MYC" "MYCL" "MYCN" "types" "DIPG_IV_1" 13.63 0.290 "DIPG" "DIPG_IV_2" 15.20.170 "DIPG" "DIPG_IV_3" 11.68 0.080 "DIPG" "BT142_1" 45.95 2.028.23"MCL" "BT142_2" 45.43 2.399.77"MCL" "BT142_3" 48.88 1.7110

Re: [R] how to create a sorted barplot and colored by groups

2020-04-19 Thread John Kane
Hi, At the moment I cannot make sense of your data. You write "I have three genes and a type column in the dataframe" but it seems to have 5 columns. Would you please supply us with the sample data in dput() format? Here are some suggestions and an example on how to do this plus other advice on as

[R] how to create a sorted barplot and colored by groups

2020-04-19 Thread aiguo li via R-help
Dear all, I need some help for creating a barplot as below.  I have three genes and a type column in the dataframe attached.  I would like to sort each gene from low to high within each type and create a barplot similar to the one below, but colored and grouped by type.  Thanks in advance for yo

[R] NA command in a 'for' loop

2020-04-19 Thread Helen Sawaya
Dear R experts, I am using a 'for' loop to apply commands to multiple datasets (each file is one participant). The only one not working is the command that identifies zeros in my datasets and changes them to NAs. But when I look at the output, zeros ("0") are still present. Surprisingly, the fu

Re: [R] Web-scraping newbie - dynamic table into R?

2020-04-19 Thread John Kane
Keno <- read_html(Kenopage) ? Or Am I misunderstanding the problem? On Sun, 19 Apr 2020 at 15:10, Julio Farach wrote: > How do I scrape the last 10 Keno draws from the Georgia lottery into R? > > > I'm trying to pull the last 10 draws of a Keno lottery game into R. I've > read several tutorial

Re: [R] Web-scraping newbie - dynamic table into R?

2020-04-19 Thread Jeff Newmiller
Web-scraping is not a common topic here, but one point that does come up is to be sure you are conforming with the website terms of use before getting in too deep. Another bit of advice is to look for the underlying API... that is usually more performant than scraping anyway. Try using the deve

[R] Web-scraping newbie - dynamic table into R?

2020-04-19 Thread Julio Farach
How do I scrape the last 10 Keno draws from the Georgia lottery into R? I'm trying to pull the last 10 draws of a Keno lottery game into R. I've read several tutorials on how to scrape websites using the rvest package, Chrome's Inspect Element, and CSS or XPath, but I'm likely stuck because the

[R] useR! 2020 St. Louis Update

2020-04-19 Thread Chris Prener
Hello all: We have made the disappointing decision to cancel useR! 2020 in St. Louis. This has been in process for several weeks, but we have not been able to share details publicly until today. We've appreciated the R community's patience as we've worked on this. We have not made any final dec

Re: [R] Multi response GAM

2020-04-19 Thread Tristan Kosciuch
Thanks, I think family=mvn(d=3) ​in mgcv gam() works! --- Tristan Kosciuch Stewart Biology Building, McGill University 1205 Dr Penfield Ave, Montreal QC H3A 1B1 From: Bert Gunter Sent: Friday, April 17, 2020 7:28 PM To: Tristan Kosciuch Cc: r-help@R-proje