How to set global variables in R

0 votes

How can we set global variables inside a function?

I am plotting multiple graphs in a single sheet.I want to add title for each one of them.

Can anyone tell me how I can achieve this?

Apr 23, 2018 in Data Analytics by DataKing99
• 8,130 points
100 views

1 answer to this question.

0 votes

To set global variables, you can use <<- operator.

a <<- "new" 

To add titles, you can use main="My title here" for each plot.

Use something like par(mar=c(3,3,3,1)) to give sufficient spacing.

answered Apr 23, 2018 by kappa3010
• 2,020 points

Related Questions In Data Analytics

0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,130 points
344 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
503 views
0 votes
1 answer

How can I define Global Variables in R?

The variables declared inside a function are ...READ MORE

answered Apr 25, 2018 in Data Analytics by shams
• 3,580 points
1,360 views
0 votes
2 answers

How to set working directory to source file location in R?

Hi,  I'm not sure about the command but you ...READ MORE

answered Aug 20 in Data Analytics by Cherukuri
• 26,220 points
2,385 views
0 votes
1 answer

How to remove all variables except functions in R?

One line that removes all objects except for functions: rm(list ...READ MORE

answered Apr 24, 2018 in Data Analytics by DeepCoder786
• 1,700 points
161 views
0 votes
1 answer

Assigning global variables from inside a function - R

You can assign global variables from inside ...READ MORE

answered May 14, 2018 in Data Analytics by Bharani
• 4,550 points
123 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 17, 2017 in Data Analytics by Sudhir
• 1,610 points
47 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
63 views
0 votes
1 answer
0 votes
1 answer