Questions tagged [desctools]

An R package: Tools for Descriptive Statistics.

A collection of miscellaneous basic statistic functions and convenience wrappers for efficiently describing data. The author's intention was to create a toolbox, which facilitates the (notoriously time consuming) first descriptive tasks in data analysis, consisting of calculating descriptive statistics, drawing graphical summaries and reporting the results.

Links:

  1. CRAN: DescTools

  2. Pdf

  3. RDocumentation

50 questions
27
votes
7 answers

Count leading zeros between the decimal point and first nonzero digit

Suppose if we have a number 1.000633, I want to count number of zeros after the decimal point until first nonzero digit in the fraction, the answer should be 3. For 0.002 the answer should be 2. There is no such function in R that could help. I have…
Annie
  • 641
  • 7
  • 13
12
votes
1 answer

How to create a grid of spatial points

library(reshape2) library(data.table) library(dplyr) library(magrittr) library(ggplot2) library(scales) library(gstat) library(DescTools) library(sp) #I want a colorado grid# data("colorado.grid") #making cordinates into spatial points…
Clinton Woods
  • 219
  • 1
  • 2
  • 9
4
votes
3 answers

Find the largest n unique values and their frequencies in R and Rcpp

I have a numeric vector v (with already omitted NAs) and want to get the nth largest values and their respective frequencies. I found http://gallery.rcpp.org/articles/top-elements-from-vectors-using-priority-queue/ to be quite fast. //…
Andri Signorell
  • 1,112
  • 10
  • 22
3
votes
1 answer

Which winsorize is more accurate, Python or R

I am trying to implement a winsorization function but get confused by the exact definition of it. Obviously, the winsorize function in R package, DescTool, and the winsorize function in Python library, scipy.stats.mstats, yield different results. I…
Bob
  • 323
  • 3
  • 13
3
votes
3 answers

DescTools::XLGetRange() fails with sel$Cells() Error: attempt to apply non-function

I am running R version 3.5.0 I have installed the packages: install.packages("DescTools") install.packages("RDCOMClient", repos = "http://www.omegahat.net/R") I have run Excel and selected a range of values. Then I run this code in…
Herman Tan
  • 41
  • 2
3
votes
2 answers

Winsorizing across all columns in a data frame (R) using `lapply`

I am trying to apply the Winsorize() function using lapply from the library(DescTools) package. What I currently have is; data$col1 <- Winsorize(data$col1) Which essentially replaces the extreme values with a value based on quantiles, replacing the…
user113156
  • 5,113
  • 4
  • 22
  • 46
3
votes
2 answers

Label rotation in PlotCirc (DescTools package)

I am using the PlotCirc() function of the DescTools R package to visualize a contingency table: library(DescTools) tab <- matrix(c(2,5,8,3,10,12,5,7,15), nrow=3, byrow=FALSE) dimnames(tab) <- list(c("ABCDEFG","BCDEFGH","CDEFGHI"),…
user2030503
  • 2,774
  • 1
  • 27
  • 48
2
votes
2 answers

Amount of overlap of two ranges in R [DescTools?]

I need to know by how many integers two numeric ranges overlap. I tried using DescTools::Overlap, but the output is not what I expected. library(DescTools) library(tidyr) df1 <- data.frame(ID = c('a', 'b', 'c', 'd', 'e'), var1 =…
ntwkid
  • 21
  • 3
2
votes
1 answer

Building a table/dataframe/something exportable from Desc function output in R

I'm definitely a noob, though I have used R for various small tasks for several years. For the life of me, I cannot figure out how to get the results from the "Desc" function into something I can work with. When I save the x<-Desc(mydata) the…
J. Doe
  • 21
  • 4
2
votes
0 answers

Insert Hyperlink datatable column R

I want to link HTML in R, I have this main datatable, id mean 22 12 17 23 and I have HTML file with datatable with name are report_22 (report_id) and this table I have just information for id 22 When I click on id 22 in the firt…
Naï
  • 53
  • 6
2
votes
2 answers

function for counting discordant pairs is not working

I am trying to count the number of discordant pairs. For example: arg1=c("b","c","a","d") arg2 = c("b","c","d","a") There is 1 discordant pair in the above (the pair: "a" and "d") But when I…
nafrtiti
  • 155
  • 7
2
votes
1 answer

Intraclass Correlation Coefficient in R, how to deal with NAs and not much overlap between raters and subjects

I have been trying to perform an icc (Intraclass Correlation Coefficient ) test for the agreement between raters in a k x m matrix. Where k are rows (subjects of study) and m are the raters. It is a 70 x 70 matrix, but it comes from randomised…
user6542375
2
votes
1 answer

How to create new columns in data.frame based on letter AND number character objects in a column in R

I have a data frame with a column filled with data like so, on chromosome and then base position, all in one column. I filled in the remaining columns V2 through V5 with integers just to simulate a similar data.frame. > test V1 V2 V3 V4…
1
vote
1 answer

Changing the Names in a Column to the most frequent Names per Group

I'm looking for a way to to calculate the most frequent name per group, and then change all names in this group to the most frequent name, or create a new column with the most frequent name. In the dataset, there may be ties in the frequent names,…
statman123
  • 77
  • 5
1
vote
3 answers

Drawing a series of circles in R

I made this image in powerpoint to illustrate what I am trying to do: I am trying to make a series of circles (each of which are the same size) that "move" along the x-axis in consistent intervals; for instance, the center of each consecutive…
Ryan
  • 818
  • 2
  • 10
1
2 3 4