R programming: For graphics

+1 vote
How do I write the following as the legend at the top left of a graph?

(\gp_1,\gp_2)=(8,7)

Here, 8 and 7 come from the value of the variables gp1 and gp2, assigned in the program.
Mar 15, 2019 in Data Analytics by Sophie may
• 10,120 points
77 views

1 answer to this question.

0 votes

Use the bquote to write the expression and place your variables gp1 and gp2 within .():

gp1 <- 7
gp2 <- 8
plot(1,1)
legend("topleft", legend=bquote((gp[1]*","*gp[2])==(.(gp1)*","*.(gp2))))
answered Mar 15, 2019 by Tyrion anex
• 8,560 points

Related Questions In Data Analytics

+1 vote
1 answer

Can we have an if loop inside a for loop in R programming?

You're If loop doesn't have any condition ...READ MORE

answered Dec 21, 2018 in Data Analytics by Sophie may
• 10,120 points
81 views
0 votes
1 answer

Does R provide support for tacit programming?

R has a package called magrittr. That's ...READ MORE

answered Jan 17, 2019 in Data Analytics by Sophie may
• 10,120 points
90 views
0 votes
1 answer

For loop in R programming.

Hi@akhtar, You can create a loop in R ...READ MORE

answered Oct 6 in Data Analytics by MD
• 81,590 points
40 views
0 votes
2 answers

Installing MXNet for R in Windows System

You can install it for python in ...READ MORE

answered Dec 3, 2018 in Data Analytics by Kalgi
• 51,970 points
816 views
0 votes
1 answer

R programming: Unexpected symbol error

Format your code this way: myfunction <- function() ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 10,120 points
1,451 views
0 votes
1 answer

R Programming error in 'fert'

You're using a factor: fert <- factor(c(50,20,10,10,20,50)) levels(fert) #[1] ...READ MORE

answered Dec 27, 2018 in Data Analytics by Sophie may
• 10,120 points
112 views
+1 vote
1 answer

R Programming: Market Basket Analysis Error

The basket.sorted() has less than 5 rules. Refer ...READ MORE

answered Feb 11, 2019 in Data Analytics by Sophie may
• 10,120 points
499 views
+1 vote
1 answer

R Programming: regexpr error

The below code will help: gregexpr("D", x) # [[1]] # ...READ MORE

answered Feb 21, 2019 in Data Analytics by Tyrion anex
• 8,560 points
80 views
+1 vote
1 answer

R programming error

Alright, you can either use gsub to match the ...READ MORE

answered Dec 18, 2018 in Data Analytics by Tyrion anex
• 8,560 points
88 views
0 votes
1 answer

Check if a matrix is diagonalizable in R Programming Language

On a given matrix, a, the first way ...READ MORE

answered Dec 24, 2018 in Data Analytics by Tyrion anex
• 8,560 points
212 views