Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
R is a programming language and environment for statistical computing and graphics. Created by Ross Ihaka and Robert Gentleman at the University of Auckland in 1993, R is widely used in data science, biostatistics, machine learning, and academic research.
R's primary tabular data structure is the data.frame — a two-dimensional, column-oriented data structure where each column has a single type.
A data.frame is R's built-in structure for tabular data. It is a list of equal-length vectors, where each vector (column) holds values of one type.
df <- data.frame(
id = c(1, 2, 3),
name = c("Alice", "Bob", "Carol"),
score = c(98.5, 87.3, 91.0),
active = c(TRUE, FALSE, TRUE)
)
Key properties:
| Property | Description |
|---|---|
| Columns are typed | Each column has a single R type (character, numeric, integer, logical) |
| Row names | Rows can have names; default is 1, 2, 3, ... |
| Heterogeneous columns | Different columns can have different types (unlike a matrix) |
| Base R | data.frame() is part of base R — no packages required |
JSON (JavaScript Object Notation) is a lightweight data-interchange format defined by RFC 8259. APIs, databases, and data pipelines output JSON.
JSON and R have different type systems. This tool converts JSON types to their correct R equivalents:
| JSON Type | JSON Example | R Type | R Output |
|---|---|---|---|
| String | "hello" | character | "hello" |
| Integer | 42 | numeric | 42 |
| Float | 3.14 | numeric | 3.14 |
| Boolean true | true | logical | TRUE |
| Boolean false | false | logical | FALSE |
| Null | null | logical | NA |
Key differences:
JSON null → R NA (R's missing-value sentinel)
JSON true / false → R TRUE / FALSE (uppercase)
JSON integers and floats both → R numeric (R's default numeric type)
JSON strings → R "string" (double-quoted character values)
| Scenario | Benefit |
|---|---|
| API data analysis | Convert API JSON responses into R data frames for analysis with dplyr, ggplot2, or base R |
| Data import | Load JSON exports into R without writing custom parsing code |
| Reproducible scripts | Generate static R code literals for R Markdown or Quarto documents |
| Teaching | Create example data frames for R tutorials and coursework |
| Testing | Generate test fixtures for R package unit tests |
| Data migration | Transform JSON data into R-compatible format for statistical modeling |
| Shiny apps | Populate R Shiny applications with static data |
File Upload: Drag and drop or select a .json file.
Code Editor: Paste or type raw JSON with syntax highlighting and real-time validation.
The tool maps JSON types to their R equivalents:
# JSON input:
# {"id": 1, "name": "Alice", "active": true, "score": 98.5, "notes": null}
# R output uses the correct types:
# id = numeric, name = character, active = logical, score = numeric, notes = NA
JSON null values are converted to R NA, which is R's standard missing-value indicator. This ensures compatibility with R's statistical functions (mean(), sd(), lm(), etc.) that handle NA natively.
The generated code is a complete, self-contained R expression. Paste it directly into an R console, R script, R Markdown chunk, or Quarto document without modification.
All processing runs entirely in your browser using JavaScript. No data is uploaded to any server.
Choose one of two input methods:
Upload a file: Click "Choose File" and select a .json file, or drag it into the upload area.
Paste data: Click "Enter Data" to switch to the code editor. Paste your JSON array. A green "Valid JSON" badge confirms correct formatting.
Click the Convert button. The R data.frame() code appears in the "Output Data" panel.
Click Copy to Clipboard to paste into your R script or R console.
Premium users can click Download File to save as an .R file.
[
{"id": 1, "name": "Alice", "role": "Engineer", "active": true},
{"id": 2, "name": "Bob", "role": "Designer", "active": false},
{"id": 3, "name": "Carol", "role": "Manager", "active": true}
]
df <- data.frame(
id = c(1, 2, 3),
name = c("Alice", "Bob", "Carol"),
role = c("Engineer", "Designer", "Manager"),
active = c(TRUE, FALSE, TRUE),
stringsAsFactors = FALSE
)
[
{"product": "Widget", "price": 9.99, "in_stock": true},
{"product": "Gadget", "price": null, "in_stock": false},
{"product": "Doohickey", "price": 24.99, "in_stock": null}
]
df <- data.frame(
product = c("Widget", "Gadget", "Doohickey"),
price = c(9.99, NA, 24.99),
in_stock = c(TRUE, FALSE, NA),
stringsAsFactors = FALSE
)
stringsAsFactors Parameter The generated code includes stringsAsFactors = FALSE. This parameter controls whether character columns are automatically converted to factors (categorical variables).
| Setting | Behavior |
|---|---|
stringsAsFactors = FALSE | Character columns remain as character strings (default since R 4.0) |
stringsAsFactors = TRUE | Character columns are converted to factors with levels |
The tool uses FALSE to match R 4.0+ default behavior and preserve the original JSON string values.
You can also parse JSON directly in R using the jsonlite package:
library(jsonlite)
df <- fromJSON('[{"id": 1, "name": "Alice"}]')
This tool is useful when you want a static R code literal rather than a runtime parse — for R Markdown documents, teaching materials, reproducible examples, or environments where installing packages is not possible.
No. All conversion happens locally in your browser using JavaScript. Your data never leaves your device.
character (strings), numeric (numbers), logical (TRUE/FALSE), and NA (from JSON null).
JSON null is converted to R NA, the standard missing-value indicator in R.
JSON true becomes R TRUE and JSON false becomes R FALSE (uppercase).
stringsAsFactors = FALSE mean? It keeps character columns as character strings instead of converting them to factors. This matches R 4.0+ default behavior.
Yes. Paste the generated code directly into an R chunk in .Rmd or .qmd files.
Yes. After pasting the code, wrap it: library(tidyverse); df <- as_tibble(df).
jsonlite::fromJSON()? fromJSON parses JSON at runtime and requires installing the jsonlite package. This tool generates a static data.frame() code literal you can paste directly — useful for reproducible documents, teaching, or environments without package installation.
The tool processes data entirely in your browser. Files up to 10 MB typically convert without issues on modern hardware.
Yes. The tool is responsive and works on smartphones and tablets.