[R] Writing a function that calls the gt() function

2021-04-25 Thread phil
I am trying to write a function that produces a table using the gt() 
function. My reprex succeeds in producing a simple table by transposing 
a data frame and creating a table from it. But when I try to convert 
this code into a function, in order to generalize for a variety of 
different data frames, I get stuck trying to blank-out the first column 
name and make the other column names bold. How can I refer to the 
columns properly in the cols_label() function in a general way? Any help 
much appreciated. Phil


\library(gt)
library(tidyverse)

# Create example data frame
blank <- c("colnam1","colnam2","colnam3","colnam4","colnam5")
rownam1 <- 1:5
rownam2 <- rnorm(5)
df <- data.frame(blank=blank,rownam1=rownam1,rownam2=rownam2)

# Transpose the data frame and prepare it for gt()
tbl_df <- as.data.frame(t(df))
hold <- rownames(tbl_df)
colnam <- tbl_df[1,]
colnames(tbl_df) <- colnam
tbl_df <- tbl_df[2:nrow(tbl_df),]
rownames(tbl_df) <- NULL
tbl_df <- mutate(tbl_df,blank=hold[2:length(hold)])
tbl_df <- select(tbl_df,blank,everything())

# Create the gt() table - this works
gt_tbl <- gt(data=tbl_df)
gt_tbl <- tab_options(gt_tbl,table.font.size=24,
container.width = 900)
gt_tbl <- tab_header(gt_tbl,
title=md(html(paste0("**","Example title","**"
gt_tbl <- cols_align(gt_tbl,
align=c("left"),
columns=vars(`blank`))
gt_tbl <- cols_label(gt_tbl,
blank="",
colnam1=md("**colnam1**"),
colnam2=md("**colnam2**"),
colnam3=md("**colnam3**"),
colnam4=md("**colnam4**"),
colnam5=md("**colnam5**"))
gt_tbl

# Now do the same = with a function
tblfunc <- function(df) {
  gt_tbl <- gt(data=df)
  gt_tbl <- tab_options(gt_tbl,table.font.size=24,
  container.width = 900)
  gt_tbl <- tab_header(gt_tbl,
  title=md(html(paste0("**","Example title","**"
  gt_tbl <- cols_align(gt_tbl,
  align=c("left"),
  columns=vars(`blank`))
  gt_tbl <- cols_label(gt_tbl,
)
}

__
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] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Larry Johnson
I'll put that in my notes.  Thanks!


​Larry Johnson

Editor and Publisher

Cobb County Courier

404-664-2034

http://cobbcountycourier.com


From: Hadley Wickham 
Sent: Sunday, April 25, 2021 7:14 PM
To: Larry Johnson 
Cc: Duncan Murdoch ; r-help@r-project.org 

Subject: Re: [R] help finding a starting point to diagnose inability to install 
or update packages

If this happens again in the future, you might try the development
version of pak:

install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/;)
pak::pak("tidyverse")

pak automatically diagnoses a number of common problems that causes
install.packages() to fail.

Hadley

On Sun, Apr 25, 2021 at 4:51 PM Larry Johnson
 wrote:
>
> It was pointed out to me by Jeff Newmiller that I should have been hitting 
> "reply all" so that others could see the thread and make comment, 
> corrections, or benefit from any solution.
>
> So, I'm going to summarize the end result.
>
> Duncan Murdoch walked me through some diagnostic steps, and what ultimately 
> worked was to run
>
> remove.packages("broom")
> install.packages("broom")
>
> and then repeat that for each of the four packages that attempts to load 
> tidyverse indicated had dependency issues (I know that last sentence was 
> ungrammatical, but you probably get my drift).
>
> I'd still like to know why updating packages in bulk isn't working for me, 
> but I can move ahead for now, and I'll figure out how to fix that later.
>
> So thanks Duncan.
>
>
> Larry Johnson
>
> Editor and Publisher
>
> Cobb County Courier
>
> 404-664-2034
>
> http://cobbcountycourier.com
>
> 
> From: Duncan Murdoch 
> Sent: Sunday, April 25, 2021 12:41 PM
> To: Larry Johnson ; r-help@r-project.org 
> 
> Subject: Re: [R] help finding a starting point to diagnose inability to 
> install or update packages
>
> On 25/04/2021 10:52 a.m., Larry Johnson wrote:
> > Hi. Short version.  tidyverse disappeared from my packages, and won't 
> > install.  The initial failure stated I had an outdated broom package, but 
> > updates are failing too, not just on broom, but on all packages, and there 
> > is no meaningful error output on the installation failures.
> >
> > I typically use RStudio on Fedora 33, but the problem I'm about to describe 
> > occurs whether I use RStudio or the text version.
> >
> > To give you overview, here is the output from sessionInfo:
> >
> >
> >> sessionInfo()
> > R version 4.0.4 (2021-02-15)
> > Platform: x86_64-redhat-linux-gnu (64-bit)
> > Running under: Fedora 33 (Workstation Edition)
> >
> > Matrix products: default
> > BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0
> >
> > locale:
> >   [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
> >   [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
> >   [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
> >   [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
> >   [9] LC_ADDRESS=C   LC_TELEPHONE=C
> > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats graphics  grDevices datasets  utils methods   base
> >
> > loaded via a namespace (and not attached):
> >   [1] htmlwidgets_1.5.3   colorspace_2.0-0scales_1.1.1
> > compiler_4.0.4
> >   [5] magrittr_2.0.1  R6_2.5.0leaflet_2.0.4.1 
> > htmltools_0.5.1.1
> >   [9] tools_4.0.4 crosstalk_1.1.1 digest_0.6.27   
> > lifecycle_1.0.0
> > [13] munsell_0.5.0   rlang_0.4.10CoprManager_0.3.7.1
> >>
> >
> > After trying complete reinstalls of R, RStudio, and the CRAN repositories 
> > here's the last error messages I've gotten in my attempts to install and 
> > load tidyverse:
> >
> >
> >> install.packages(c("broom", "callr", "cli", "cpp11", "dbplyr", "haven", 
> >> "highr", "knitr", "pillar", "processx", "RcppArmadillo", "reprex", 
> >> "tibble", "tinytex", "vctrs", "viridis", "viridisLite", "withr"))
> > Install system packages...
> >> install.packages("tidyverse")
> > Install system packages...
> >> library(tidyverse)
> > Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j 
> > <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
> >   namespace ‘broom’ 0.7.5 is being loaded, but >= 0.7.6 is required
> >
> > Attempts to install or update broom fail with no output.
> >
> > I've been searching for similar reports of failure here in these archives, 
> > on the RStudio forums, and on the internet and have found nothing that's a 
> > seamless match.  If I can't find anything I'll check out filing a bug 
> > report (I've never done it with R before).
> >
> > Any help with a starting point in diagnosing this will be appreciated.
>
> Are you using install_github(), or otherwise installing non-CRAN
> versions?  If so, stop doing that. First, run update.packages(ask=FALSE)
> to make sure you are up to date.  Then delete any package that is newer
> than the CRAN version, and reinstall it using the basic install.packages().

Re: [R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Hadley Wickham
If this happens again in the future, you might try the development
version of pak:

install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/;)
pak::pak("tidyverse")

pak automatically diagnoses a number of common problems that causes
install.packages() to fail.

Hadley

On Sun, Apr 25, 2021 at 4:51 PM Larry Johnson
 wrote:
>
> It was pointed out to me by Jeff Newmiller that I should have been hitting 
> "reply all" so that others could see the thread and make comment, 
> corrections, or benefit from any solution.
>
> So, I'm going to summarize the end result.
>
> Duncan Murdoch walked me through some diagnostic steps, and what ultimately 
> worked was to run
>
> remove.packages("broom")
> install.packages("broom")
>
> and then repeat that for each of the four packages that attempts to load 
> tidyverse indicated had dependency issues (I know that last sentence was 
> ungrammatical, but you probably get my drift).
>
> I'd still like to know why updating packages in bulk isn't working for me, 
> but I can move ahead for now, and I'll figure out how to fix that later.
>
> So thanks Duncan.
>
>
> Larry Johnson
>
> Editor and Publisher
>
> Cobb County Courier
>
> 404-664-2034
>
> http://cobbcountycourier.com
>
> 
> From: Duncan Murdoch 
> Sent: Sunday, April 25, 2021 12:41 PM
> To: Larry Johnson ; r-help@r-project.org 
> 
> Subject: Re: [R] help finding a starting point to diagnose inability to 
> install or update packages
>
> On 25/04/2021 10:52 a.m., Larry Johnson wrote:
> > Hi. Short version.  tidyverse disappeared from my packages, and won't 
> > install.  The initial failure stated I had an outdated broom package, but 
> > updates are failing too, not just on broom, but on all packages, and there 
> > is no meaningful error output on the installation failures.
> >
> > I typically use RStudio on Fedora 33, but the problem I'm about to describe 
> > occurs whether I use RStudio or the text version.
> >
> > To give you overview, here is the output from sessionInfo:
> >
> >
> >> sessionInfo()
> > R version 4.0.4 (2021-02-15)
> > Platform: x86_64-redhat-linux-gnu (64-bit)
> > Running under: Fedora 33 (Workstation Edition)
> >
> > Matrix products: default
> > BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0
> >
> > locale:
> >   [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
> >   [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
> >   [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
> >   [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
> >   [9] LC_ADDRESS=C   LC_TELEPHONE=C
> > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats graphics  grDevices datasets  utils methods   base
> >
> > loaded via a namespace (and not attached):
> >   [1] htmlwidgets_1.5.3   colorspace_2.0-0scales_1.1.1
> > compiler_4.0.4
> >   [5] magrittr_2.0.1  R6_2.5.0leaflet_2.0.4.1 
> > htmltools_0.5.1.1
> >   [9] tools_4.0.4 crosstalk_1.1.1 digest_0.6.27   
> > lifecycle_1.0.0
> > [13] munsell_0.5.0   rlang_0.4.10CoprManager_0.3.7.1
> >>
> >
> > After trying complete reinstalls of R, RStudio, and the CRAN repositories 
> > here's the last error messages I've gotten in my attempts to install and 
> > load tidyverse:
> >
> >
> >> install.packages(c("broom", "callr", "cli", "cpp11", "dbplyr", "haven", 
> >> "highr", "knitr", "pillar", "processx", "RcppArmadillo", "reprex", 
> >> "tibble", "tinytex", "vctrs", "viridis", "viridisLite", "withr"))
> > Install system packages...
> >> install.packages("tidyverse")
> > Install system packages...
> >> library(tidyverse)
> > Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j 
> > <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
> >   namespace ‘broom’ 0.7.5 is being loaded, but >= 0.7.6 is required
> >
> > Attempts to install or update broom fail with no output.
> >
> > I've been searching for similar reports of failure here in these archives, 
> > on the RStudio forums, and on the internet and have found nothing that's a 
> > seamless match.  If I can't find anything I'll check out filing a bug 
> > report (I've never done it with R before).
> >
> > Any help with a starting point in diagnosing this will be appreciated.
>
> Are you using install_github(), or otherwise installing non-CRAN
> versions?  If so, stop doing that. First, run update.packages(ask=FALSE)
> to make sure you are up to date.  Then delete any package that is newer
> than the CRAN version, and reinstall it using the basic install.packages().
>
> Here's code to compare versions:
>
> CRAN <- available.packages()
> here <- installed.packages()
> for (i in seq_len(nrow(here))) {
>if (here[i, "Package"] %in% rownames(CRAN) &&
>package_version(here[i, "Version"]) >
>  package_version(CRAN[here[i, "Package"], "Version"]))
>  cat(here[i, c("Package", "Version")], "\n", sep=" " )
> }
>
> Duncan Murdoch
>
> 

Re: [R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Larry Johnson
It was pointed out to me by Jeff Newmiller that I should have been hitting 
"reply all" so that others could see the thread and make comment, corrections, 
or benefit from any solution.

So, I'm going to summarize the end result.

Duncan Murdoch walked me through some diagnostic steps, and what ultimately 
worked was to run

remove.packages("broom")
install.packages("broom")

and then repeat that for each of the four packages that attempts to load 
tidyverse indicated had dependency issues (I know that last sentence was 
ungrammatical, but you probably get my drift).

I'd still like to know why updating packages in bulk isn't working for me, but 
I can move ahead for now, and I'll figure out how to fix that later.

So thanks Duncan.


​Larry Johnson

Editor and Publisher

Cobb County Courier

404-664-2034

http://cobbcountycourier.com


From: Duncan Murdoch 
Sent: Sunday, April 25, 2021 12:41 PM
To: Larry Johnson ; r-help@r-project.org 

Subject: Re: [R] help finding a starting point to diagnose inability to install 
or update packages

On 25/04/2021 10:52 a.m., Larry Johnson wrote:
> Hi. Short version.  tidyverse disappeared from my packages, and won't 
> install.  The initial failure stated I had an outdated broom package, but 
> updates are failing too, not just on broom, but on all packages, and there is 
> no meaningful error output on the installation failures.
>
> I typically use RStudio on Fedora 33, but the problem I'm about to describe 
> occurs whether I use RStudio or the text version.
>
> To give you overview, here is the output from sessionInfo:
>
>
>> sessionInfo()
> R version 4.0.4 (2021-02-15)
> Platform: x86_64-redhat-linux-gnu (64-bit)
> Running under: Fedora 33 (Workstation Edition)
>
> Matrix products: default
> BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>   [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>   [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>   [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>   [9] LC_ADDRESS=C   LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices datasets  utils methods   base
>
> loaded via a namespace (and not attached):
>   [1] htmlwidgets_1.5.3   colorspace_2.0-0scales_1.1.1
> compiler_4.0.4
>   [5] magrittr_2.0.1  R6_2.5.0leaflet_2.0.4.1 
> htmltools_0.5.1.1
>   [9] tools_4.0.4 crosstalk_1.1.1 digest_0.6.27   
> lifecycle_1.0.0
> [13] munsell_0.5.0   rlang_0.4.10CoprManager_0.3.7.1
>>
>
> After trying complete reinstalls of R, RStudio, and the CRAN repositories 
> here's the last error messages I've gotten in my attempts to install and load 
> tidyverse:
>
>
>> install.packages(c("broom", "callr", "cli", "cpp11", "dbplyr", "haven", 
>> "highr", "knitr", "pillar", "processx", "RcppArmadillo", "reprex", "tibble", 
>> "tinytex", "vctrs", "viridis", "viridisLite", "withr"))
> Install system packages...
>> install.packages("tidyverse")
> Install system packages...
>> library(tidyverse)
> Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- 
> i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
>   namespace ‘broom’ 0.7.5 is being loaded, but >= 0.7.6 is required
>
> Attempts to install or update broom fail with no output.
>
> I've been searching for similar reports of failure here in these archives, on 
> the RStudio forums, and on the internet and have found nothing that's a 
> seamless match.  If I can't find anything I'll check out filing a bug report 
> (I've never done it with R before).
>
> Any help with a starting point in diagnosing this will be appreciated.

Are you using install_github(), or otherwise installing non-CRAN
versions?  If so, stop doing that. First, run update.packages(ask=FALSE)
to make sure you are up to date.  Then delete any package that is newer
than the CRAN version, and reinstall it using the basic install.packages().

Here's code to compare versions:

CRAN <- available.packages()
here <- installed.packages()
for (i in seq_len(nrow(here))) {
   if (here[i, "Package"] %in% rownames(CRAN) &&
   package_version(here[i, "Version"]) >
 package_version(CRAN[here[i, "Package"], "Version"]))
 cat(here[i, c("Package", "Version")], "\n", sep=" " )
}

Duncan Murdoch

[[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] input string ... cannot be translated to UTF-8, is it valid in 'ANSI_X3.4-1968'?

2021-04-25 Thread John Kane
The tab format seems to read in with no problem.

On Thu, 22 Apr 2021 at 23:08, Duncan Murdoch  wrote:
>
> On 22/04/2021 9:25 p.m., Spencer Graves wrote:
> > Hello:
> >
> >
> > What if anything should I do regarding notes from either "load" or
> > "attach" that, "input string ... cannot be translated to UTF-8, is it
> > valid in 'ANSI_X3.4-1968'?"?
>
> First, ANSI_X3.4-1968  is an official name for for a version of Ascii.
> It appears in the file near the start, where I believe it records the
> native encoding in place when the file was written, so readers using a
> different encoding can translate.
>
> Your actual file appears to have been encoded in UTF-8, but not marked
> as such.  You're lucky you read it on macOS, where UTF-8 is the native
> encoding, since the reader probably recognized the bytes weren't ascii
> bytes (and warned you about that), then just left them alone.  If you
> read that file on Windows you'd likely get junk for those entries.
>
> For your interest, here's a dump of the start of your file, after
> gunzipping it:
>
>   52 44 58 33 0a 58 0a 00  00 00 03 00 03 06 00 00
> |RDX3.X..|
> 0010  03 05 00 00 00 00 0e 41  4e 53 49 5f 58 33 2e 34
> |...ANSI_X3.4|
> 0020  2d 31 39 36 38 00 00 04  02 00 00 00 01 00 04 00
> |-1968...|
> 0030  09 00 00 00 01 78 00 00  03 13 00 00 00 10 00 00
> |.x..|
> 0040  02 0e 00 00 02 6e 40 90  0c 00 00 00 00 00 40 90
> |.n@...@.|
> 0050  44 00 00 00 00 00 40 10  00 00 00 00 00 00 40 7c
> |D.@...@||
>
> Duncan Murdoch
>
> >
> >
> > I'm running R 4.0.5 under macOS 11.2.3;  see "sessionInfo()" and
> > detailed instructions below on the precise file I dowloaded from the web
> > and tried to read.
> >
> >
> > I may be able to get what I want just ignoring this.  However, I'd
> > like to know how to fix this.
> >
> >
> > Thanks,
> > Spencer Graves
> >
> >
> > sessionInfo()
> > R version 4.0.5 (2021-03-31)
> > Platform: x86_64-apple-darwin17.0 (64-bit)
> > Running under: macOS Big Sur 10.16
> >
> > Matrix products: default
> > LAPACK:
> > /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
> >
> > locale:
> > [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> >
> > attached base packages:
> > [1] stats graphics  grDevices utils datasets  methods   base
> >
> > loaded via a namespace (and not attached):
> >[1] compiler_4.0.5htmltools_0.5.1.1 tools_4.0.5   yaml_2.2.1
> >
> >[5] tinytex_0.31  rmarkdown_2.7 knitr_1.31
> > digest_0.6.27
> >[9] xfun_0.22 rlang_0.4.10  evaluate_0.14
> >   > search()
> >[1] ".GlobalEnv""file:NAVCO 1.3 List.RData"
> >[3] "file:NAVCO 1.3 List.RData" "tools:rstudio"
> >[5] "package:stats" "package:graphics"
> >[7] "package:grDevices" "package:utils"
> >[9] "package:datasets"  "package:methods"
> > [11] "Autoloads" "package:base"
> >
> >
> > *** To get the file I used for this, I went to
> > "https://www.ericachenoweth.com/research;.  From there I clicked
> > "Version 1.3".  This took me to
> >
> >
> > https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/ON9XND
> >
> >
> > I then clicked the "Download" icon to the right of "NAVCO 1.3 List.tab".
> >This gave me 5 "Download Options", one of which was "RData Format";  I
> > selected that.  This downloaded "NAVCO 1.3 List.RData", which I moved to
> > getwd().  Then I did 'load("NAVCO 1.3 List.RData")' and 'attach("NAVCO
> > 1.3 List.RData")'.  Both of those gave me 8 repetitions of a message
> > like "input string ... cannot be translated to UTF-8, is it valid in
> > 'ANSI_X3.4-1968'?" with different values substituted for "...".
> >
> > __
> > 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-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.



-- 
John Kane
Kingston ON Canada

__
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] Query

2021-04-25 Thread John Kane
What package has the irf function?

On Fri, 23 Apr 2021 at 09:34, Sun Yong Kim
 wrote:
>
> Hi
>
> I have been trying to circulate a question but my question keeps getting 
> rejected. Let me try again via email. The message is below:
>
> I am trying to change the tick size for IRF graphs that I created using the 
> following code below:
>
> par(mfrow=c(2,3))
> IRF_F2 <- irf(SVARmod1, impulse="deltaw2",
>   response=c("Belgium","France","Germany","Italy","Netherlands"),
> n.ahead=60)
> plot(IRF_F2,ylim=c(-0.5,0.3), plot.type="single", main="US Wealth Share
> Shock")
>
> The code gives me the following IRFs I have attached to this email. However 
> the tick intervals is way too small and I want to change it to intervals of 
> 10. I was thinking something like:
>
> par(mfrow=c(2,3))
> IRF_F2 <- irf(SVARmod1, impulse="deltaw2",
>
> response=c("Belgium","France","Germany","Italy","Netherlands"),
> n.ahead=60)
> plot(IRF_F2,ylim=c(-0.5,0.3), plot.type="single", main="US Wealth
> Share Shock", xaxt="n")
> axis(side= 1, at = c(10, 20, 30, 40, 50, 60))
>
> But it doesn't work. Any suggestions on how to reduce the tick interval?
> __
> 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.



-- 
John Kane
Kingston ON Canada

__
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] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Jeff Newmiller
These are all contributed packages... don't file a bug report on R. Also, 
tidyverse is a rediculously sprawling meta-package that seems prone to faulty 
dependency data.

If you have a oroblem getting the right version of broom then focus on solving 
that. One possibility is that your CRAN mirror is not up-to-date.. try a 
different one or wait a few days for the updates to prooagate. Sometimes all it 
takes is to update or re-install the offending package. If you want to push the 
envelope you can use devtools::install_github or similar to bypass CRAN, but it 
is possible that that version had a problem identified in the CRAN review that 
you might have trouble with.

Whst is your options("repos") set to?

On April 25, 2021 7:52:28 AM PDT, Larry Johnson 
 wrote:
>Hi. Short version.  tidyverse disappeared from my packages, and won't
>install.  The initial failure stated I had an outdated broom package,
>but updates are failing too, not just on broom, but on all packages,
>and there is no meaningful error output on the installation failures.
>
>I typically use RStudio on Fedora 33, but the problem I'm about to
>describe occurs whether I use RStudio or the text version.
>
>To give you overview, here is the output from sessionInfo:
>
>
>> sessionInfo()
>R version 4.0.4 (2021-02-15)
>Platform: x86_64-redhat-linux-gnu (64-bit)
>Running under: Fedora 33 (Workstation Edition)
>
>Matrix products: default
>BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0
>
>locale:
> [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
> [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
> [9] LC_ADDRESS=C   LC_TELEPHONE=C
>[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
>attached base packages:
>[1] stats graphics  grDevices datasets  utils methods   base
>
>loaded via a namespace (and not attached):
>[1] htmlwidgets_1.5.3   colorspace_2.0-0scales_1.1.1   
>compiler_4.0.4
>[5] magrittr_2.0.1  R6_2.5.0leaflet_2.0.4.1
>htmltools_0.5.1.1
>[9] tools_4.0.4 crosstalk_1.1.1 digest_0.6.27  
>lifecycle_1.0.0
>[13] munsell_0.5.0   rlang_0.4.10CoprManager_0.3.7.1
>>
>
>After trying complete reinstalls of R, RStudio, and the CRAN
>repositories here's the last error messages I've gotten in my attempts
>to install and load tidyverse:
>
>
>> install.packages(c("broom", "callr", "cli", "cpp11", "dbplyr",
>"haven", "highr", "knitr", "pillar", "processx", "RcppArmadillo",
>"reprex", "tibble", "tinytex", "vctrs", "viridis", "viridisLite",
>"withr"))
>Install system packages...
>> install.packages("tidyverse")
>Install system packages...
>> library(tidyverse)
>Error: package or namespace load failed for ‘tidyverse’ in
>loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
>vI[[j]]):
> namespace ‘broom’ 0.7.5 is being loaded, but >= 0.7.6 is required
>
>Attempts to install or update broom fail with no output.
>
>I've been searching for similar reports of failure here in these
>archives, on the RStudio forums, and on the internet and have found
>nothing that's a seamless match.  If I can't find anything I'll check
>out filing a bug report (I've never done it with R before).
>
>Any help with a starting point in diagnosing this will be appreciated.
>
>Thanks,
>
>
>​Larry Johnson
>
>Editor and Publisher
>
>Cobb County Courier
>
>404-664-2034
>
>http://cobbcountycourier.com
>
>   [[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.

-- 
Sent from my phone. Please excuse my brevity.

__
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] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Duncan Murdoch

On 25/04/2021 10:52 a.m., Larry Johnson wrote:

Hi. Short version.  tidyverse disappeared from my packages, and won't install.  
The initial failure stated I had an outdated broom package, but updates are 
failing too, not just on broom, but on all packages, and there is no meaningful 
error output on the installation failures.

I typically use RStudio on Fedora 33, but the problem I'm about to describe 
occurs whether I use RStudio or the text version.

To give you overview, here is the output from sessionInfo:



sessionInfo()

R version 4.0.4 (2021-02-15)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 33 (Workstation Edition)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0

locale:
  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
  [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices datasets  utils methods   base

loaded via a namespace (and not attached):
  [1] htmlwidgets_1.5.3   colorspace_2.0-0scales_1.1.1compiler_4.0.4
  [5] magrittr_2.0.1  R6_2.5.0leaflet_2.0.4.1 
htmltools_0.5.1.1
  [9] tools_4.0.4 crosstalk_1.1.1 digest_0.6.27   
lifecycle_1.0.0
[13] munsell_0.5.0   rlang_0.4.10CoprManager_0.3.7.1




After trying complete reinstalls of R, RStudio, and the CRAN repositories 
here's the last error messages I've gotten in my attempts to install and load 
tidyverse:



install.packages(c("broom", "callr", "cli", "cpp11", "dbplyr", "haven", "highr", "knitr", "pillar", "processx", "RcppArmadillo", "reprex", 
"tibble", "tinytex", "vctrs", "viridis", "viridisLite", "withr"))

Install system packages...

install.packages("tidyverse")

Install system packages...

library(tidyverse)

Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- 
i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
  namespace ‘broom’ 0.7.5 is being loaded, but >= 0.7.6 is required

Attempts to install or update broom fail with no output.

I've been searching for similar reports of failure here in these archives, on 
the RStudio forums, and on the internet and have found nothing that's a 
seamless match.  If I can't find anything I'll check out filing a bug report 
(I've never done it with R before).

Any help with a starting point in diagnosing this will be appreciated.


Are you using install_github(), or otherwise installing non-CRAN 
versions?  If so, stop doing that. First, run update.packages(ask=FALSE)
to make sure you are up to date.  Then delete any package that is newer 
than the CRAN version, and reinstall it using the basic install.packages().


Here's code to compare versions:

CRAN <- available.packages()
here <- installed.packages()
for (i in seq_len(nrow(here))) {
  if (here[i, "Package"] %in% rownames(CRAN) &&
  package_version(here[i, "Version"]) >
package_version(CRAN[here[i, "Package"], "Version"]))
cat(here[i, c("Package", "Version")], "\n", sep=" " )
}

Duncan Murdoch

__
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-es] Consulta

2021-04-25 Thread Juan Abasolo
Buen domingo.
Mientras contesta la gente que sabe, te diría que te fijaras en Telegram.
Hay quichicientos grupos de Python. En el buscador ponés Python y te
empiezan a aparecer.
Depués te va a tocar encontrar alguno que vaya por el palo que vas vos, que
eso es todo un trabajo.

Y seguramente haya alguno de tu zona.

Juan

Hau idatzi du Notification Team (alejandro...@hotmail.com) erabiltzaileak
(2021 api. 25, ig. (01:25)):

> Buen día grupo,
>
> Alguien sabe si existe un grupo similar a este, pero donde se pueda hacer
> preguntas sobre Python. Agradecería mucho cualquier direccionamiento.
> Muchas gracias.
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>


-- 
Juan Abasolo, PhD

Hizkuntzaren eta Literaturaren Didaktika Saila | EUDIA ikerketa taldea
Bilboko Hezkuntza Fakultatea
Euskal Herriko Unibertsitatea
UPV/EHU

Sarriena auzoa z/g 48940 - Leioa (Bizkaia)

T   : (+34) 94 601 7567
Telegram: @JuanAbasolo
Skype   : abasolo72

Tutoretza ordutegia 
[blo ][gak
]

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Larry Johnson
Hi. Short version.  tidyverse disappeared from my packages, and won't install.  
The initial failure stated I had an outdated broom package, but updates are 
failing too, not just on broom, but on all packages, and there is no meaningful 
error output on the installation failures.

I typically use RStudio on Fedora 33, but the problem I'm about to describe 
occurs whether I use RStudio or the text version.

To give you overview, here is the output from sessionInfo:


> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 33 (Workstation Edition)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices datasets  utils methods   base

loaded via a namespace (and not attached):
 [1] htmlwidgets_1.5.3   colorspace_2.0-0scales_1.1.1compiler_4.0.4
 [5] magrittr_2.0.1  R6_2.5.0leaflet_2.0.4.1 
htmltools_0.5.1.1
 [9] tools_4.0.4 crosstalk_1.1.1 digest_0.6.27   lifecycle_1.0.0
[13] munsell_0.5.0   rlang_0.4.10CoprManager_0.3.7.1
>

After trying complete reinstalls of R, RStudio, and the CRAN repositories 
here's the last error messages I've gotten in my attempts to install and load 
tidyverse:


> install.packages(c("broom", "callr", "cli", "cpp11", "dbplyr", "haven", 
> "highr", "knitr", "pillar", "processx", "RcppArmadillo", "reprex", "tibble", 
> "tinytex", "vctrs", "viridis", "viridisLite", "withr"))
Install system packages...
> install.packages("tidyverse")
Install system packages...
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- 
i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 namespace ‘broom’ 0.7.5 is being loaded, but >= 0.7.6 is required

Attempts to install or update broom fail with no output.

I've been searching for similar reports of failure here in these archives, on 
the RStudio forums, and on the internet and have found nothing that's a 
seamless match.  If I can't find anything I'll check out filing a bug report 
(I've never done it with R before).

Any help with a starting point in diagnosing this will be appreciated.

Thanks,


​Larry Johnson

Editor and Publisher

Cobb County Courier

404-664-2034

http://cobbcountycourier.com

[[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.