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

61 questions
0
votes
1 answer

R function to determine the overlap between two date intervals -- DescTools Interval Function

I'm looking for a way to determine the overlap (in days) between two date intervals. I have columns startdate1, enddate1, startdate2, enddate2. I want an additional column with the number of days of overlap between the intervals (startdate1,…
123raa
  • 1
  • 2
0
votes
1 answer

Winsorize function: Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) : undefined columns selected

I want to winsorize my data, which looks like following (in total 134 observations): company id rev size age 1 Adeg 29.9 0.66 160 45 2 Agrana 32.0 2.80 …
HAL_71
  • 111
  • 1
  • 1
  • 3
0
votes
1 answer

R Winsorizing with specific cut-off values does not work

I want to winsorize my data using the mean plus (/minus) 2 standard deviations of the variable as cut-off points. I thus want to winsorize every variable one by one. The variable I want to winsorize in the example code I provided below has 5…
j_brokelm
  • 19
  • 4
0
votes
2 answers

Installing DescTools in 3.3.3 causes RStudio to crash

I'm using R 3.3.3, because it can be read by SPSS 25. If I try to instal the package "DescTools" the app closes itself. CRAN says that "DescTools" works on R 3.3.0 and above. Are there different packages? If so, how do I replace the faulty one,…
user801855
  • 15
  • 4
0
votes
0 answers

R shiny Error: object 'input' not found, when used in eventReactive and Desctools

I know it might be duplicated, and I have sought for several questions that is similar with, but I still can not find why my code not work on. The error occurs when two input sources are compiled to the eventReactive part. My bug code like…
pauke Huang
  • 71
  • 1
  • 8
0
votes
1 answer

Trim data using lapply to remove outliers

I am trying to use lapply to trim some of my data. What I am trying to do is trim columns 2:4 (deleting the outliers or extreme values) but also remove the rows across the columns. Some data with outliers in each column. So I want to remove values…
user113156
  • 6,761
  • 5
  • 35
  • 81
0
votes
1 answer

R - using LIKE operator with variable

I want to substitute a variable instead of a string in the %like% function from DescTools package. What I want to do with it after is to have a loop where the variable changes value and I get a different results. I've tried a few ways but can't get…
jmich738
  • 1,565
  • 3
  • 24
  • 41
0
votes
1 answer

r - within-subject winsorization

I have a long-format dataframe data.set, in which each subject has different numeric values (data.set$target_resp.rt) per conditions. I have already winsorized my data with respect to an overall criterion by using the DescTool function Winsorize…
RobertP.
  • 213
  • 1
  • 12
0
votes
0 answers

Why is the Mantel-Haenszel test returning a confidence interval of infinity?

When I set alternative = "greater" when using a mantelhaen.test, the upper confidence interval returned is Inf. Why does this happen, and can I fix it? I'm not sure if this issue is rooted in the programming (maybe the format of my data?) or if it's…
Emily
  • 470
  • 5
  • 16
0
votes
2 answers

forloop/foreach to run each var in data using same model in r

My data looks like this q3a q3b q3c q3d q3e ... q10d grp 1 2 3 4 5 ... 1 1 2 1 2 3 4 2 1 3 2 1 5 2 ... 1 2 2 1 2 1 1 ... 2 2 2 3 4 1 2 ... 3 3 I want to run one-way anova…
mandy
  • 483
  • 9
  • 20
0
votes
0 answers

How extract values in a lists, generated by loops

I have to extract p.values of a seven t2 hottelling test generated by loop this data were generated by computer, changing the correlation. I need extract the all pvalues for make a plot. i=numeric(0) p1=numeric(0) pv=numeric(0) for(i in 3:9){ …
0
votes
2 answers

R: trimming a variable and adding it to a dataframe

I am an R beginner. I would like to trim a variable using the Trim function of the package "DescTools". This works fine with: mydata <- data.frame( a <- rnorm(40, mean = 0, sd = 1) ) a_trim <- Trim(mydata$a, trim = 0.2, na.rm = TRUE) This creates…
00schneider
  • 698
  • 9
  • 21
0
votes
0 answers

How to run Scheffe test with Anova from 'car' package in R

I am using Anova function from 'car' package in R to do 3 - way split plot analysis in R. I know there is a function ScheffeTest in the package 'DescTools' to run Scheffe Test for 'aov' function. My question is, how could I run Scheffe test for the…
mommomonthewind
  • 4,390
  • 11
  • 46
  • 74
0
votes
0 answers

Missing columns names when using sapply to pass a function

I am trying to loop over the columns in a dataframe to get descriptives. Since some columns throw errors, I wanted to use tryCatch function to ignore the error & continue. For this purpose I use sapply and pass the formula.In this process, I lose…
JeanVuda
  • 1,738
  • 14
  • 29
0
votes
1 answer

Save and close a word document by giving a name in R

I am trying to use two libraries (DescsTool, R2wd) in order to get descriptive analysis of a dataset saved in a folder for exploration later. These are the steps I am trying library(DescTools) library(R2wd) data(iris) i <- ls() wrd <-…
JeanVuda
  • 1,738
  • 14
  • 29