Re: [R] mice package won't install

2020-07-23 Thread Ivan Krylov
On Thu, 23 Jul 2020 12:44:57 -0400 David Krackhardt wrote: > When I try to install Rtools, it tells me the current version is > actually Rtools40. When I try to install Rtools40, it tells me that > Rtools40 is not available for R version 3.6.3, which is the newest > version of R (and the one I h

[R] mice package won't install

2020-07-23 Thread David Krackhardt
When I try to install the "mice" package, it tells me I can't without a current version of Rtools. When I try to install Rtools, it tells me the current version is actually Rtools40. When I try to install Rtools40, it tells me that Rtools40 is not available for R version 3.6.3, which is the newes

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Rui Barradas
Hello, These two gives the same results: aggregate(values ~ sex + status, mydata, sum) #  sex status values #1   0  0    224 #2   1  0   5227 #3   0  1 11 #4   1  1    552 by(mydata$values, list(mydata$sex, mydata$status), sum) #: 0 #: 0 #[1] 224 #-

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Rasmus Liland
On 2020-07-24 01:48 +0200, Rasmus Liland wrote: > aggregate(x=list("values"=mydata$values), > by=list("sex"=mydata$sex, > "status"=mydata$status), > FUN=sum) > > yields > > sex status values > 1 0 0224 >

[R] Arranging ggplot2 objects with ggplotGrob()

2020-07-23 Thread H
I am trying to arrange two plots vertically, ie plot 2 below plot 1, where I want the plots to align columnwise but have a height ratio of eg 3:1. My attempts so far after consulting various webpages is that the following code aligns them columnwise correctly but I have, so far, failed in settin

Re: [R] [External] Re: Playing a music file in R

2020-07-23 Thread Rasmus Liland
On 2020-07-23 16:25 -0700, Henrik Bengtsson wrote: > FWIW, see also the 'midi' R package > (https://github.com/moodymudskipper/midi). > It's not on CRAN. /Henrik Interesting! I tried to play the midi running these lines, but failed: > mid <- midi::midi$new(file.path(find.package("mi

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Rasmus Liland
On 2020-07-23 18:54 -0400, Duncan Murdoch wrote: > On 23/07/2020 6:15 p.m., Sorkin, John wrote: > > Colleagues, > > The by function in the R program below is not giving me the sums > > I expect to see, viz., > > 382+170=552 > > 4730+170=4900 > > 5+6=11 > > 199+25=224 > > ###

Re: [R] [External] Re: Playing a music file in R

2020-07-23 Thread Henrik Bengtsson
FWIW, see also the 'midi' R package (https://github.com/moodymudskipper/midi). It's not on CRAN. /Henrik On Thu, Jul 23, 2020 at 12:19 PM Rasmus Liland wrote: > > On 2020-07-23 14:19 -0400, Richard M. Heiberger wrote: > > On Thu, Jul 23, 2020 at 7:21 AM bretschr wrote: > > > > > > Dear Vahid,

Re: [R] curl options?

2020-07-23 Thread Rasmus Liland
On 2020-07-23 14:56 -0700, Roy Mendelssohn - NOAA Federal via R-help wrote: > I am trying to get the following command to work: > > > sshInfo <- rerddap::info('hawaii_soest_f75b_adc6_12ab', url = > > 'https://apdrc.soest.hawaii.edu/erddap/') > > On a Mac at least (but I know for a > fact not n

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Duncan Murdoch
On 23/07/2020 6:15 p.m., Sorkin, John wrote: Colleagues, The by function in the R program below is not giving me the sums I expect to see, viz., 382+170=552 4730+170=4900 5+6=11 199+25=224 ### #full R program: mydata <- data.frame(covid=c(0,0,0,

Re: [R] help with web scraping

2020-07-23 Thread William Michels via R-help
Hi Spencer, I tried the code below on an older R-installation, and it works fine. Not a full solution, but it's a start: > library(RCurl) Loading required package: bitops > url <- > "https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975"; > M_sos <- getURL(

Re: [R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Bert Gunter
by() chooses **data frame** subsets -- sum() is acting on these frames, adding up everything in them. Try this instead: > by(mydata,list(mydata$sex,mydata$status),function(x)sum(x$values)) : 0 : 0 [1] 224 --- : 1 : 0 [1] 5227

[R] by function with sum does not give what is expected from by function with print

2020-07-23 Thread Sorkin, John
Colleagues,   The by function in the R program below is not giving me the sums I expect to see, viz., 382+170=552 4730+170=4900 5+6=11 199+25=224 ### #full R program: mydata <- data.frame(covid=c(0,0,0,0,1,1,1,1), sex=(rep(c(1,1,0,0),2)), status=rep(

[R] curl options?

2020-07-23 Thread Roy Mendelssohn - NOAA Federal via R-help
I am trying to get the following command to work: > sshInfo <- rerddap::info('hawaii_soest_f75b_adc6_12ab', url = > 'https://apdrc.soest.hawaii.edu/erddap/') On a Mac at least (but I know for a fact not necessarily on other OSes) I get: > Error in curl::curl_fetch_memory(x$url$url, handle = x$

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread Jeff Newmiller
All you did was include the dput command in your example. We need the output of dput, not the command itself. On July 23, 2020 2:43:31 PM PDT, Neha gupta wrote: >David, I understand that the file will not be in your directory but I >have >provided the data using dput? Didn't I? Previously member

[R] help with web scraping

2020-07-23 Thread Spencer Graves
Hello, All:   I've failed with multiple attempts to scrape the table of candidates from the website of the Missouri Secretary of State: https://s1.sos.mo.gov/CandidatesOnWeb/DisplayCandidatesPlacement.aspx?ElectionCode=750004975       I've tried base::url, base::readLines, xml2::read_h

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread Neha gupta
David, I understand that the file will not be in your directory but I have provided the data using dput? Didn't I? Previously members of this group have used dput to provide the detail about their data. Seriously, I have no idea how else I can provide a reproducible example.

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread David Winsemius
On 7/23/20 9:34 AM, Neha gupta wrote: > > Hello David, file not found should be the path problem I guess. I just > forgot the pROC library, which I included here. These are all the > libraries I am using. > > library(caret) > library(farff) > library(DMwR) > library(pROC) > library(pls) > > set

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread Jeff Newmiller
The R Administration and Installation manual explains this nomenclature. OP _is_ typically using two libraries... the one installed with R and the "personal" library which contains the packages installed by the user. You retrieve packages from libraries using library(somepackage) Of more releva

Re: [R] [External] Re: Playing a music file in R

2020-07-23 Thread Rasmus Liland
On 2020-07-23 14:19 -0400, Richard M. Heiberger wrote: > On Thu, Jul 23, 2020 at 7:21 AM bretschr wrote: > > > > Dear Vahid, > > > > > > Re: > > > > > I have a question regarding the > > > following code: > > > setWavPlayer("/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/play") > > >

Re: [R] [External] Re: Playing a music file in R

2020-07-23 Thread Richard M. Heiberger
The R command system.file() tells you where the currently running version of R is located on your machine and your operating system. On the Macintosh it shows > system.file() [1] "/Library/Frameworks/R.framework/Resources/library/base" You don't need to worry about the R version number, as R kno

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread Bert Gunter
Actually, you are using no libraries. You are using R *packages* . Don't ask me why the call is library() and not package() -- I'm just another worker bee. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breat

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread Neha gupta
Hello David, file not found should be the path problem I guess. I just forgot the pROC library, which I included here. These are all the libraries I am using. library(caret) library(farff) library(DMwR) library(pROC) library(pls) setwd("C:/Users/PC/Documents") d=readARFF("bughunter.arff") dput( h

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread David Winsemius
On 7/23/20 7:01 AM, Neha gupta wrote: > > library(caret) > library(farff) > library(DMwR) > > d=readARFF("bughunter.arff") Error in readARFF("bughunter.arff") :   Assertion on 'path' failed: File does not exist: 'bughunter.arff'. I say again: > I suggest you read the Posting Guide, > restar

Re: [R] Error in Rose Method (class balancing)

2020-07-23 Thread Neha gupta
Hello David, thanks for your reply. I have added the information. library(caret) library(farff) library(DMwR) d=readARFF("bughunter.arff") dput( head( d, 30 ) ) index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE) tr <- d[index, ] ts <- d[-index, ] boot3 <- trainControl(method =

[R] Notes of music in R

2020-07-23 Thread Vahid Borji
Hellol, I am trying to compose and play the start music of the serial "Game of Thrones" in R. I would like to do it by making a vector of notes of this music, then play this vector. I have read the following link, it is about making "Jingle Bells" music: https://towardsdatascience.com/compose-and

Re: [R] Question about citing R packages in an academic paper

2020-07-23 Thread Dr. Mehdi Dadkhah
Thank you very much! With best regards Dr. Mehdi Dadkhah Email: drdadk...@outlook.com Website: drdadkhah.click From: Michael Dewey Sent: Thursday, July 23, 2020 1:06 PM To: Dr. Mehdi Dadkhah ; r-help@r-project.org Subject: Re: [R] Question about citing R packag

Re: [R] [External Email] how to generate this kind of graph

2020-07-23 Thread Christopher W Ryan
You might like the beeswarm package. --Chris Ryan SUNY Upstate Medical University and Broome County Health Department On Thu, Jul 23, 2020 at 1:15 AM array chip via R-help wrote: > > Hello everyone, > > I saw this scatterplots from a paper and thought it looked very nice: > > > https://drive.go

Re: [R] Playing a music file in R

2020-07-23 Thread bretschr
Dear Vahid, Re: > I have a question regarding the following code: > setWavPlayer("/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/play") ># path depends on your R version etc. > > How can I find the corresponding path on my laptop? This line ... setWavPlayer("/Library/Framewo

Re: [R] Playing a music file in R

2020-07-23 Thread bretschr
Dear Vahid, Re: > I have a question regarding the following code: > setWavPlayer("/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/play") ># path depends on your R version etc. > > How can I find the corresponding path on my laptop? This line ... setWavPlayer("/Library/Framewo

Re: [R] Reading help functions

2020-07-23 Thread Eric Berger
Hi Pedro, Reading R help pages definitely takes practice. Here's a tip: when you bring up the help page, scroll down to the bottom to see if there are examples (there usually are.) I find that seeing examples often provides enough information to let you figure out what you need to do. HTH, Eric

Re: [R] Question about citing R packages in an academic paper

2020-07-23 Thread Michael Dewey
Dear Medhi It is good that you are going to cite the packages properly. I do not think it matters too much whether they are in the article itself or in the supplementary material, the important thing is that they are there. You do not have any legal obligation to cite them, as far as I know a

Re: [R] Reading help functions

2020-07-23 Thread Michael Dewey
Dear Pedro If you prefer reading in Spanish which from your name may be the case then if you go to CRAN, click on Documentation | Contributed you will find some documentation in Spanish including several aimed at beginners. There are some in Portuguese as well if I have mis-interpreted your na

Re: [R] Playing a music file in R

2020-07-23 Thread Jim Lemon
Thie "system" command in R takes the first argument and passes that to the shell in which R is running. 1) I run R in the bash shell under Fedora Linux version 30 2) I have installed "mplayer" as an audio/visual player that can be called from the bash shell 3) The command I pass says "Start the mpl