0

I have created an object of unique values:

obj <- c("A", "B", "C", "D", "E")

I would like to print it in the following message:

message("The zones are:", obj,"\n")

but the output all values are joint together:

#The zones are:ABCDE

I would like to have the values comma separated

I also tried print(paste0("The zones are:", obj,"\n")) but it gives even worse output

yuliaUU
  • 1,220
  • 1
  • 10
  • 28

1 Answers1

0

We can use toString to create a single string that is comma separated

 message("The zones are:", toString(unique(obj)), "\n")
akrun
  • 789,025
  • 32
  • 460
  • 575