Re: [R] Sometimes commands do not terminate after upgrading to R 4.0 and Ubuntu 20.04

2020-05-09 Thread Enrico Schumann
> "Adrien" == Adrien FABRE writes: Adrien> I have upgraded R (from 3.6 to 4.0) and RStudio (from 1.1 to 1.2.5) a few Adrien> days ago, and Ubuntu from 18.04 to 20.04 yesterday. Adrien> Since then, R sometimes never terminates when executing certain commands: Adrien> ivreg (from pac

Re: [R] Date format

2020-05-09 Thread Rainer Hurling
Am 10.05.20 um 04:17 schrieb Bert Gunter: > $date is a factor, which is coded as numeric values internally, which > as.date sees as numeric, and therefore: > "as.Date will accept numeric data (the number of days since an epoch), > but only if origin is supplied." (from ?as.Date) as.Date is also ab

Re: [R] Date format

2020-05-09 Thread Bert Gunter
True. Whence the error message then? Still, in my attempt to reproduce, the format statement worked. 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 Sat, May 9,

Re: [R] Date format

2020-05-09 Thread Jeff Newmiller
... but str says it is character. This must be 4.0... On May 9, 2020 7:17:16 PM PDT, Bert Gunter wrote: >$date is a factor, which is coded as numeric values internally, which >as.date sees as numeric, and therefore: >"as.Date will accept numeric data (the number of days since an epoch), >but only

Re: [R] Date format

2020-05-09 Thread Bert Gunter
$date is a factor, which is coded as numeric values internally, which as.date sees as numeric, and therefore: "as.Date will accept numeric data (the number of days since an epoch), but only if origin is supplied." (from ?as.Date) You need to supply a format argument to as.Date to get it to handle

Re: [R] Loop inside dplyr::mutate

2020-05-09 Thread Richard M. Heiberger
## I start with sim_data_wide sim_data_wide <- tidyr::spread(sim_data, quarter, pd) ## and calculate wide wide1 <- with(sim_data_wide, cbind(PC_1 = P_1, PC_2 = 1-(1-P_1)*(1-P_2), PC_3 = 1-(1-P_1)*(1-P_2)*(1-P_3), PC_4 = 1-(1-P_1

Re: [R] predicting waste per capita - is a gaussian model correct?

2020-05-09 Thread Jeff Newmiller
It could possibly be alright, except that: a) you included no reference to your other post b) you posted here using HTML format, which can severely corrupt what we see on this plain text only mailing list c) your question is off topic, as your question is about statistics (theory) rather than R

Re: [R] Loop inside dplyr::mutate

2020-05-09 Thread Jeff Newmiller
Does this help? sim_wide2 <- ( sim_data %>% arrange( borrower_id, quarter ) %>% group_by( borrower_id ) %>% mutate( cumpd = 1 - cumprod( 1 - pd ) ) %>% ungroup() %>% mutate( qlbl = paste0( "PC_", quarter ) ) %>% select( borrower_id, qlbl, cumpd ) %>% spread( qlbl, cumpd ) ) On May 9, 2020 4:4

[R] Sometimes commands do not terminate after upgrading to R 4.0 and Ubuntu 20.04

2020-05-09 Thread Adrien FABRE
I have upgraded R (from 3.6 to 4.0) and RStudio (from 1.1 to 1.2.5) a few days ago, and Ubuntu from 18.04 to 20.04 yesterday. Since then, R sometimes never terminates when executing certain commands: ivreg (from package AER), summary (of a logit regression) and logitmfx (from package mfx). Sometim

[R] predicting waste per capita - is a gaussian model correct?

2020-05-09 Thread Alessandra Bielli
Dear list, I am new to this list and I hope it is ok to post here even though I already posted this question on Cross Validated. I am trying to predict the daily amount of waste per person produced in the fishery sector. We surveyed fishing boats at the end of their fishing trip and the variables

Re: [R] Loop inside dplyr::mutate

2020-05-09 Thread Fox, John
Dear Axel, Assuming that you're not wedded to using mutate(): > D1 <- 1 - as.matrix(sim_data_wide[, 2:11]) > D2 <- matrix(0, 10, 10) > colnames(D2) <- paste0("PC_", 1:10) > for (i in 1:10) D2[, i] <- 1 - apply(D1[, 1:i, drop=FALSE], 1, prod) > all.equal(D2, as.matrix(sim_data_wide[, 22:31])) [1]

[R] the volcano orientation

2020-05-09 Thread Michael Sumner
Does anyone know why 'volcano' is oriented as it is? image(volcano) ## filled.contour is the same I know it's all arbitrary, but north-up is a pretty solid convention. Is there any reason why the classic 'image()' example data set would not default to this orientation? A Google map of the site

[R] Date format

2020-05-09 Thread Medic
I took a SAMPLE CODE (for Connected scatterplot) from the R gallery and applied to MY DATA, but got: "Error in as.Date.numeric(mydata$date) : 'origin' must be supplied". P.S. I can not understand ?as.Date() SAMPLE CODE library(ggplot2) library(dplyr) library(hrbrthemes) data <- read.table("https:

[R] Loop inside dplyr::mutate

2020-05-09 Thread Axel Urbiz
Hello, Is there a less verbose approach to obtaining the PC_i variables inside the mutate? library(tidyverse) sim_data <- data.frame(borrower_id = sort(rep(1:10, 20)), quarter = rep(1:20, 10), pd = runif(length(rep(1:20, 10 # conditional probs

Re: [R] Error in summary.warnings?

2020-05-09 Thread Allison Meisner
Great! Thanks for sharing your fix. Allison From: Martin Maechler Sent: Saturday, May 9, 2020 11:37 AM To: Allison Meisner ; r-help@r-project.org Cc: Martin Maechler Subject: Re: [R] Error in summary.warnings? > Martin Maechler > on Fri, 8 May 202

Re: [R] [External] Re: A stopifnot() nastiness, even if not a bug

2020-05-09 Thread luke-tierney
Since you asked ... There are two different use cases for stopifnot: in tests and in implementation code. stopifnot seems to be optimized for the test code case where speed and clarity may not be that important. For expresing assertions in implemantation code clarity and simplicity are importan

Re: [R] ggplot2 axis

2020-05-09 Thread Rui Barradas
Hello, I cannot reproduce this. If I do db <- iris[3:5] names(db) <- c("length", "width", "support") and change 'lenght' to 'length' in the ggplot call both axis are plotted. But the code is not reproducible, db is missing. Can you post the output of dput(head(db, 30)) in a next mail? Hope

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread Dirk Eddelbuettel
On 9 May 2020 at 10:30, Dirk Eddelbuettel wrote: | | We can see that you use Linux. | | Are you by chance | | - on a Debian or Ubuntu system, and | - have the libopenblas package installed ? | | If so then it is a known bug with the libopenblas0-pthread package. | | Installing libopen0-op

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread J C Nash
I get the output at the bottom, which seems OK. Can you include sessionInfo() output? Possibly this is a quirk of the particular distro or machine, BLAS or LAPACK, or something in your workspace. However, if we have full information, someone may be able to run the same setup in a VM (if I have th

Re: [R] Error in summary.warnings?

2020-05-09 Thread Martin Maechler
> Martin Maechler > on Fri, 8 May 2020 17:37:29 +0200 writes: > Allison Meisner > on Thu, 7 May 2020 19:32:36 + writes: > I believe there is an error in the summary.warnings function (typically called via 'summary(warnings())'). Below is a minimal working exampl

Re: [R] A stopifnot() nastiness, even if not a bug

2020-05-09 Thread Martin Maechler
> Martin Maechler > on Mon, 13 Apr 2020 22:30:35 +0200 writes: > William Dunlap > on Mon, 13 Apr 2020 09:57:11 -0700 writes: >> You can avoid the problem in Martin's example by only giving scalars to >> stopifnot(). E.g., using stopifnot(all(x>0)) or stopifnot(l

Re: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread Dirk Eddelbuettel
We can see that you use Linux. Are you by chance - on a Debian or Ubuntu system, and - have the libopenblas package installed ? If so then it is a known bug with the libopenblas0-pthread package. Installing libopen0-openmp (and also removing libopenblas0-pthread) should fix it. This is li

[R] ggplot2 axis

2020-05-09 Thread João Marreiros
Dear users, Does anyone had a problem with ggplot concerning the axis not being shown? (see attachment) ggplot(db, aes (x = lenght, y = width, color = support)) +   geom_point(size=2) +   stat_ellipse() +   labs(x="Lenght (mm)", y="width (mm)", title="Boxplot", color = "Support") I'm using the

[R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread ‍고병민 [ 학부재학 / 경제학과 ]
Dear list, there is a bug with the *solve() *function that I cannot find a solution for a month. So I ask for your help. *Whenever I try to invert a matrix using the said function, the console hangs*. Below I explain more about this situation. Consider the code D = matrix( data = c(1, 2, 3, 4),

[R] [R-pkgs] New version 'spsur' for the estimation of Spatial Seemingly Unrelated Regression

2020-05-09 Thread Fernando A López Hernández
Dear all I am pleased to announce that the R package ‘spsur’ for the estimation of Spatial Seemingly Unrelated Regression upload a new version in the CRAN. https://cran.r-project.org/web/packages/spsur/index.html This version of ‘spsur’

Re: [R] Need a suggestion on a package to make a figure

2020-05-09 Thread Jim Lemon
Hi again, Oops, you'll need the images as well. Save the HTML file and images to the same directory. Jim On Sat, May 9, 2020 at 9:24 PM Jim Lemon wrote: > > Hi Aiguo > Just for fun, I tried to work out what you wanted. I think you are > looking for a function that creates a horizontal stacked ba

Re: [R] Need a suggestion on a package to make a figure

2020-05-09 Thread Jim Lemon
Hi Aiguo Just for fun, I tried to work out what you wanted. I think you are looking for a function that creates a horizontal stacked bar image of a logical vector: TFbar<-function(x,file="TFbar",grDev="png",width=100,height=25, col=c("green","red")) { do.call(grDev, list(file=paste(file,grDev

[R] genericSummary in LSAfun

2020-05-09 Thread Mehdi Dadkhah
Hi, I hope you are doing well! I have a data frame with a column. it contains about 140 posts. In each row, there is a blog post. I named this data frame as "posttext". When i use genericSummary() function, it returns paragraph instead sentences. What is problem? Command which i use: summaryp<-

Re: [R] Change the colours of some of the labels of the x-axis

2020-05-09 Thread Stefano Sofia
Thank you very much. Stefano (oo) --oOO--( )--OOo Stefano Sofia PhD Civil Protection - Marche Region Meteo Section Snow Section Via del Colle Ameno 5 60126 Torrette di Ancona, Ancona Uff: 071 806 7743 E-mail: stefano.so...@regione.marche.it ---Oo-oO---

[R] [R-pkgs] mathjaxr: Using 'Mathjax' in Rd Files

2020-05-09 Thread Viechtbauer, Wolfgang (SP)
Dear All, I would like to announce the release of the 'mathjaxr' package: https://cran.r-project.org/package=mathjaxr The package provides MathJax and a handful of macros to enable its use within Rd files for rendering equations in the HTML help files. Package authors wanting to make use of t

[R] [R-pkgs] addScales package available on CRAN

2020-05-09 Thread Bert Gunter
addScales is a small package that modifies trellis objects created using lattice graphics by adding horizontal and/or vertical reference lines that provide visual scaling information. This is mostly useful for multi-panel plots that use the relation = 'free' option in their 'scales' argument list.

Re: [R] Question about package "SentimentAnalysis"

2020-05-09 Thread Mehdi Dadkhah
Thank you! On Sat, May 9, 2020 at 11:44 AM wrote: > Or, to split the paragraph into sentences, analyse each sentence and > decide how to agregate the result... > > > > On 9 May 2020 04:33, Mehdi Dadkhah wrote: > > Thank you! > > On Fri, May 8, 2020 at 10:04 PM John Kane wrote: > > > I think yo