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

Lag (Hmisc) with a shift argument defined in another column R

To make it simple, i would like a column C to be equal to the Lag of a column B, with the shift argument depending on the integers in the column A, so I want: A | B | C 0 | 5 | 5 2 | 6 | NA 3 | 7 | NA 2 | 8 | 6 I tried: …
MCmr
  • 11
  • 2
0
votes
1 answer

Error when importing SAS xpt files in R

I am trying to import an xpt file into R using read.xport from both SASxport and foreign package but somehow I keep getting below error message: Error in lookup.xport.inner(file) : SAS transfer file has incorrect library header The same error…
Xinting WANG
  • 1,905
  • 2
  • 15
  • 20
0
votes
1 answer

Points in CIMPLICITY HMI

I have a HMI Cimplicity and I have to create new variables. I open the Workbench and go to the points, but I can´t do anything, I have to copy a variable and paste with different name, but I don´t know that I can´t. How can I do? Thanks for all.
garci
  • 87
  • 3
  • 8
0
votes
1 answer

Finding correlation with p-value in R using Hmisc package

I am trying to find the correlation between variables of a dataframe in R. My head of the dataframe is below. > head(datafile) Taxon Petals Internode Sepal Bract Petiole Leaf Fruit 1 I 5.621498 29.48060 2.462107 18.20341…
0
votes
1 answer

Avoiding empty and small groups when using pretty_breaks with cut2

I'm working with variables resembling the data val values created below: # data -------------------------------------------------------------------- data("mtcars") val <- c(mtcars$wt, 10.55) I'm cutting this variable in the following manner: #…
Konrad
  • 17,740
  • 16
  • 106
  • 167
0
votes
1 answer

Color of histograms from data frame in R

In R, hist.data.frame (from Hmisc) produces a histogram for each column in a data frame, but I can't figure out how to change the colors of the bars. Is there any way I can do this? library(Hmisc) tmp<-data.frame(c(1,1,2,3),c(2,2,1,3)) # histograms…
Jeff
  • 12,147
  • 10
  • 51
  • 87
0
votes
2 answers

How to pass paired argument to summaryM function test in Hmisc [r]

I have reproducible example here library(Hmisc) set.seed(173) sex <- factor(sample(c("m","f"), 500, rep=TRUE)) country <- factor(sample(c('US', 'Canada'), 500, rep=TRUE)) age <- rnorm(500, 50, 5) sbp <- rnorm(500, 120, 12) label(sbp) <- 'Systolic…
0
votes
1 answer

latex table from describe function in Hmisc

I've been trying to get a latex output for the table below by adding latex(describe) or latex(xtable) before the requested fuction in Hmisc but that does not work. Any idea of where the error is? <
yojan2001
  • 21
  • 3
0
votes
1 answer

How To Filter A Dataframe On a Factor

I used cut2 from the Hmisc package to create grouped PenRages in my data1 dataframe below. How do I filter my dataframe on the PenRanges so that I only get the rows with a group of [ 0.0, 12.8)? District Retail Loans …
user1609391
  • 445
  • 1
  • 9
  • 24
0
votes
1 answer

How to specify correctly a file

i'm trying to import a spss- dataset in R. I already tried read.spss and spss.get, both gave me the same error: meinspss <- read.spss(C:\Dokumente und Einstellungen\Caspar\Desktop\Studium\Master\SoSe 14\Aktuelle FF der emp. Finanzwissenschaft und…
Caspar
  • 19
  • 8
0
votes
2 answers

Extract coefficients' p-value from fit.mult.impute

I've used multiple imputation in R to deal with missing values using the aregImpute function from the Hmisc library. For analysis, I use the fit.mult.impute function to correct the variance for the multiple imputation process. I want to create a…
0
votes
2 answers

R: Produce machine-readable output for summary / describe

I have a data frame with 10k rows and 500 columns. For each column, I want to create a count for each unique value in the row. E.g. Fruit Vegetable Meat 1 Apple Carrot Steak 2 Apple Potato Chicken 3 Pear Peas…
MA2
  • 43
  • 4
0
votes
1 answer

r Hmisc::dataframeReduce - replicate actions from one dataset to identically structured dataset

I'm working on subsets of data from multiple time periods and I'd like to do column and level reduction on my training set and then apply the same actions to other datasets of the same structure. dataframeReduce in the Hmisc package is what I've…
Steph Locke
  • 5,951
  • 4
  • 39
  • 77
0
votes
1 answer

Non-numeric x-axis using xYplot

I am trying to plot a graph in which the x-axis has non-numeric data represented by labels created from numeric data. Let me explain with my mock example. The data.log file used in my example can be found in here [pastie.org]. When executing my…
Eduardo
  • 4,282
  • 2
  • 49
  • 63
0
votes
1 answer

R- different variable classes when assigned outside and inside a function?

this is probably PICNIC, but I'm getting a rather odd set of behaviour when trying to build a function than I do when performing the actions in the console. I'm trying to use cut2 to produce a set of intervals and assign them to a variable for later…
Steph Locke
  • 5,951
  • 4
  • 39
  • 77
1 2 3
14
15