-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsimple_test.R
More file actions
47 lines (36 loc) · 989 Bytes
/
simple_test.R
File metadata and controls
47 lines (36 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Simple test script for README examples
library(devtools)
library(testthat)
# Load the package
load_all()
# Run the examples from README
cat("\nTesting default call...\n")
df <- gmd()
print(head(df))
cat("\nTesting specific version...\n")
df <- gmd(version = "2025_01")
print(head(df))
cat("\nTesting specific country...\n")
df <- gmd(country = "USA")
print(head(df))
cat("\nTesting multiple countries...\n")
df <- gmd(country = c("USA", "CHN", "DEU"))
print(head(df))
cat("\nTesting specific variables...\n")
df <- gmd(variables = c("rGDP", "infl", "unemp"))
print(head(df))
cat("\nTesting raw data...\n")
df <- gmd(variables = "rGDP", raw = TRUE)
print(head(df))
cat("\nTesting list variables...\n")
gmd(vars = TRUE)
cat("\nTesting list countries...\n")
gmd(iso = TRUE)
cat("\nTesting combined parameters...\n")
df <- gmd(
version = "2025_01",
country = c("USA", "CHN"),
variables = c("rGDP", "unemp", "CPI")
)
print(head(df))
cat("\nAll README examples completed!\n")