# Create calculation fails with no applicable method for 'count' applied to an object of class "c('double', 'numeric')"

**URL:** <https://community.exploratory.io/t/create-calculation-fails-with-no-applicable-method-for-count-applied-to-an-object-of-class-c-double-numeric/4135>\
**Category:** Issues\
**Created:** [January 13, 2026, 5:10pm UTC](https://community.exploratory.io/t/create-calculation-fails-with-no-applicable-method-for-count-applied-to-an-object-of-class-c-double-numeric/4135 "2026-01-13T17:10:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hide\_Kojima1](https://community.exploratory.io/user_avatar/community.exploratory.io/hide_kojima1/32/398_2.png) [@Hide\_Kojima1](https://community.exploratory.io/u/Hide_Kojima1)\
**Post date:** [January 13, 2026, 5:10pm UTC](https://community.exploratory.io/t/create-calculation-fails-with-no-applicable-method-for-count-applied-to-an-object-of-class-c-double-numeric/4135/1 "2026-01-13T17:10:05Z")

</div>

## Problem

When using the `count()` function within a Create Calculation step, you may encounter the following error:

```r
Error in count(...) : no applicable method for 'count' applied to an object of class "c('double', 'numeric')"

```

This occurs because `count()` is designed to work on data frames or grouped data, not on individual columns or vectors within a calculation context.

## Solution

Use `n()` instead of `count()` in your Create Calculation step.

**Why this works:** The `n()` function is specifically designed for use within data manipulation operations (like `summarize()` or `mutate()`) and returns the number of observations in the current group or dataset, making it the appropriate choice for calculations.

**Example:**

```r
# Instead of this (which causes an error):
count(column_name)

# Use this:
n()

```

If you need to count specific conditions, you can combine `sum()` with logical conditions:

```r
# Count rows where a condition is TRUE
sum(column_name > 10, na.rm = TRUE)

```
