-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layout ggplots in a table #139
base: master
Are you sure you want to change the base?
Changes from 1 commit
e5a6803
d11bd6f
ae7bd35
e516b9a
6ba7e6a
89c1e2f
e53e7d9
0ae75de
adf012b
a2b8c0a
45bbcf7
4951b0b
96c5a45
0a78f92
a692b3d
95cd30f
6999ac7
91d0abb
5b05e8a
2e1a5f5
9af1fe8
a1735d2
8698e18
fbd9541
d4c90aa
80943e6
4ac2937
4a4d8ea
7fa9efe
3499fea
905feb3
0287024
00040cc
e46f73c
3cefb99
efcd2c5
071eeb5
744a638
0fe67a8
57d530b
c1fbe30
8da6e6c
dbbfcc7
e671218
42eaf91
3a3141b
cb45b68
06d5c10
0368b85
28f5cac
c5e4c8c
aa07dd9
7b31296
70d550d
d3e15b3
731041f
06d02c8
1eff5de
0ecc99f
54fcb77
3a11c39
a21e13b
841c4ff
87ecfda
47544aa
c66cdb0
d9e0310
446e549
ff96811
9624583
3996202
700f1d9
4580713
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
|
||
test_that("check if two plots exist", { | ||
data1 <- data.frame( | ||
x = c(1, 2, 3), # x-coordinates of the dots | ||
y = c(1, 4, 9) # y-coordinates of the dots | ||
) | ||
|
||
plot1 <- ggplot(data1, aes(x, y)) + | ||
geom_point(size = 2) + # Plot points with a specified size | ||
ggtitle("Plot of 3 Dots") + # Add a title to the plot | ||
xlab("X Axis") + ylab("Y Axis") | ||
|
||
data2 <- data.frame( | ||
x = c(1, 2), # x-coordinates of the dots | ||
y = c(1, 4) # y-coordinates of the dots | ||
) | ||
|
||
plot2 <- ggplot(data2, aes(x, y)) + | ||
geom_point(size = 2) + # Plot points with a specified size | ||
ggtitle("Plot of 2 Dots") + # Add a title to the plot | ||
xlab("X Axis") + ylab("Y Axis") | ||
|
||
data3 <- data.frame( | ||
x = c(2), # x-coordinates of the dots | ||
y = c(2) # y-coordinates of the dots | ||
) | ||
|
||
plot3 <- ggplot(data3, aes(x, y)) + | ||
geom_point(size = 2) + # Plot points with a specified size | ||
ggtitle("Plot of 1 Dot") + # Add a title to the plot | ||
xlab("X Axis") + ylab("Y Axis") | ||
|
||
plot_list <- list( | ||
plot1 = plot1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please avoid numbers in variable names (plot1 plot2 plot3) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for example plot names in the layout test could be |
||
plot2=plot2, | ||
plot3=plot3 | ||
) | ||
|
||
info <-animint2HTML(plot_list) | ||
titles <- getNodeSet(info$html, "//text[@class='plottitle']") | ||
expect_match(xmlValue(titles[[1]]), "Plot of 3 Dots") | ||
expect_match(xmlValue(titles[[2]]), "Plot of 2 Dots") | ||
expect_match(xmlValue(titles[[3]]), "Plot of 1 Dot") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change c(2) to 2