Questions tagged [hmisc]

Hmisc is an R package of miscellaneous utility functions.

Hmisc is an package of miscellaneous functions by Frank Harrell. It contains many functions useful for , ting, utility operations, functions for computing and power, importing datasets, imputing , advanced table making, , manipulation, conversion of R objects to code, and recoding variables.

Repositories

Other resources

Related tags

216 questions
0
votes
2 answers

How to force Hmisc package in R to round to 3 decimals?

I have a correlation matrix produced using the Hmisc package. It produces the correlations to 2 decimal places, however I would like it to show 3 decimals places. How do I force it to do so? I am using the rcorr function. Data: df <-…
aspark2020
  • 341
  • 2
  • 17
0
votes
0 answers

Does anyone know how to fix this Hmisc error?

Trying to run Hmisc, but I'm getting this error: Error: package or namespace load failed for ‘Hmisc’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘knitr’ Does anyone know how to…
Krish
  • 1
0
votes
0 answers

Number of digits when latex printing a coldiag object from R

I am trying to get a latex table of a condition index table. The minimum working example is below. It prints, but it gives a huge number of digits (whether I write to the screen or to a file, and even if I set the options(digits =…
Peter Flom
  • 2,008
  • 4
  • 22
  • 35
0
votes
1 answer

Corrplot.mixed plot (number and square together)

Trying to put together the coefficient values (lower corner) and significance (upper corner) Try using corrplot.mixed but doing something wrong library(corrplot) library(Hmisc) mydata <- read.csv("HiBAPPaperv2_Corre.csv") mydata.cor = cor(mydata,…
Ale
  • 43
  • 6
0
votes
1 answer

Looking up a column name in a different data.table and use the information when there is a match

I would like to store the Group information of the data.table below (DT1) as a label for the column names of a second data.table. The column names of the second data.table (DT2) are identical to the nr information of the first…
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
1 answer

Using R Hmisc summary/summaryM latex command within Knitr Markdown pdf

I have been trying to get the Hmisc latex.summary and latex.summaryM examples to work within a pdf document created using Knitr in RStudio. But keep getting error messages. The example data is: options(digits=3) set.seed(173) sex <-…
JWilliman
  • 3,558
  • 32
  • 36
0
votes
1 answer

Issue installing Hmisc in Rstudio and calling in the library

I've had the following error for the package Hmisc. I read another thread which asked more about the error message however it said not to post this as a comment. I've installed the package and received the following error when calling in the…
Emmie
  • 1
  • 1
0
votes
0 answers

How to solve '' aregImpute error : 'column_name' is constant ''

I would like to delete some of the entries in my dataframe and impute them by using the remaining information by means of aregImpute function. However, when I randomly delete 25% of the data in some of the columns, some columns are left with only…
0
votes
0 answers

Bootcov in rms package not working when cluster variable included in regression as fixed effect

I'm trying to use bootcov to get clustered standard errors for a regression analysis on panel data. In the analysis, I'm including the cluster variable as a fixed effect to address cluster-level confounding. However, including the cluster variable…
kang6789
  • 1
  • 2
0
votes
1 answer

error in creating dummy variables for each continuous variable in dataframe

I have a dataset which has 10 columns and these are continuous data. A sample of the same is collected through dput() and shon below: structure(list(x1 = c(12.800454545, 17.71, 5.805, 13.111875, 14.121428571, 12.800454545, 17.71, 5.805, 13.111875,…
LeMarque
  • 733
  • 5
  • 21
0
votes
1 answer

Show complete plot line in gap.plot

I am trying to create a gap.plot using the plotrix package in R. I can create the broken axes well enough, but I'm trying to show a broken line within the plot at the same location and have drawn a blank. Here's what I have so…
A.Benson
  • 465
  • 1
  • 6
  • 16
0
votes
1 answer

Using a list / dataframe / vector to assign labels to column names of a dataframe with Hmisc

I would like to use the column Variables of a dataframe: Variables Varcode Country Ccode 2000 2001 1 Power P France FR 1213 1234 2 Happiness H France FR 1872 2345 3 Power P UK UK 1726 6433 4…
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
1 answer

Dataframe does not correctly reshape

I have the following dataframe: Variables Varcode Country Ccode 2000 2001 1 Power P France FR 1213 1234 2 Happiness H France FR 1872 2345 3 Power P UK UK 1726 6433 4 Happiness H UK …
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
0 answers

Problems storing correlation in matrix using rcorr from the Hmisc package

I want to calculate the p-values for the correlation of two matricies using Hmisc. I am having a problem storing the resulting p-values in a matrix: library("Hmisc") x <- as.matrix(read.table("tmp01")) y <- as.matrix(read.table("tmp02")) P <-…
yueli
  • 43
  • 7
0
votes
1 answer

R: incorporating fisher.test into Hmisc's summaryM leads to error

catTestfisher <- function (tab) { st <- if (!is.matrix(tab) || nrow(tab) < 2 | ncol(tab) < 2) list(p.value = NA, statistic = NA, parameter = NA) else { rowcounts <- tab %*% rep(1, ncol(tab)) tab <-…
Adrian
  • 9,229
  • 24
  • 74
  • 132