Explore

Find agent skills by outcome

15,120 skills indexed with the new KISS metadata standard.

Showing 24 of 15,120Categories: Productivity, Data, Research & Learning, Coding & Debugging
Data
PromptBeginner5 minmarkdown

- Formula interface (`aggregate(y ~ x

data

0
Coding & Debugging
PromptBeginner5 minmarkdown

- `as.numeric(f)` returns **integer codes**

not original values. Use `as.numeric(levels(f))[f]` or `as.numeric(as.character(f))`.

0
Data
PromptBeginner5 minmarkdown

- For data frames

operates on whole rows. For lists

0
Data
PromptBeginner5 minmarkdown

- `rbind` on data frames matches columns **by name**

not position. Missing columns get `NA`.

0
Data
PromptBeginner5 minmarkdown

- Result is always an **array** (even 1D)

class table. Convert to data frame with `as.data.frame(tbl)`.

0
Data
PromptBeginner5 minmarkdown

- `cbind` on data frames calls `data.frame(...)`

not `cbind.matrix`. Mixing matrices and data frames can give unexpected results.

0
Data
PromptBeginner5 minmarkdown

- Default `by` is `intersect(names(x)

names(y))` — can silently merge on unintended columns if data frames share column names.

0
Data
PromptBeginner5 minmarkdown

- Returns an **array** (not a data frame). Class info on return values is **discarded** (e.g.

Date objects become numeric).

0
Data
PromptBeginner5 minmarkdown

- On a **data frame**

`apply` coerces to matrix via `as.matrix` first — mixed types become character.

0
Data
PromptBeginner5 minmarkdown

- Matrix indexing a data frame (`df[cbind(i

j)]`) coerces to matrix first — avoid.

0
Data
PromptBeginner5 minmarkdown

- Data frame `[` with single column: `df[

1]` returns a **vector** (drop=TRUE default for columns)

0
Data
PromptBeginner5 minmarkdown

- `subset` argument uses **non-standard evaluation** — column names are resolved in the data frame

which can silently pick up wrong variables in programmatic use. Use `[` with explicit logic in functions.

0
Coding & Debugging
PromptBeginner5 minmarkdown

- Factor indexing: `x[f]` uses integer codes of factor `f`

not its character labels. Use `x[as.character(f)]` for label-based indexing.

0
Data
PromptBeginner5 minmarkdown

- `ts(data

start

0
Data
PromptBeginner5 minmarkdown

- `relist(flesh

skeleton)` — `flesh` is the flat data

0
Data
PromptBeginner5 minmarkdown

- Useful pattern: `do.call(rbind

list_of_dfs)` to combine a list of data frames.

0
Data
PromptBeginner5 minmarkdown

- **io-and-text.md** — Read when: read.table silently drops data or misparses columns

regex behaves differently than expected

0
Data
PromptBeginner5 minmarkdown

- **visualization.md** — Read when: par settings reset unexpectedly

layout/mfrow interaction is confusing

0
Data
PromptBeginner5 minmarkdown

- **statistics.md** — Read when: hypothesis test gives surprising result

need to choose correct p.adjust method

0
Data
PromptBeginner5 minmarkdown

- **data-wrangling.md** — Read when: subsetting returns wrong type

apply on data frame gives unexpected coercion

0
Data
PromptBeginner5 minmarkdown

fit <- aov(value ~ group

data = df)

0
Data
PromptBeginner5 minmarkdown

predict(fit

newdata = new_df)

0
Data
PromptBeginner5 minmarkdown

fit <- lm(y ~ x1 + x2

data = df)

0
Data
PromptBeginner5 minmarkdown

boxplot(value ~ group

data = df

0