Reputation: 21
When I run View()
to view the data after creating the array, I cannot view the data in tabular form. Instead I see the name, type and values of this data as seen in the screenshot. What do I need to do to view the data in the Data Viewer Panel?
a<-array(c('HI','all','!!'),dim = c(3,5,5))
View(a)
Upvotes: 0
Views: 835
Reputation: 5081
In R programming, the View()
command prints the output to the Data Viewer 1 panel. Data Viewer panel is only compatible with data in data frame format; not compatible for printing arrays 2.
data(iris)
View(iris)
After converting an array to a matrix in the R programming language, you can display it in the Data Viewer using the View()
command. For example:
a <- array(c('HI','all','!!'),dim = c(3,5,5))
View(apply(a, 3, c))
You can use the print()
command to print the contents of a value to the console.
a <- array(c('HI','all','!!'),dim = c(3,5,5))
print(a)
1. Using The Data Viewer in the RStudio IDE
2. R Language Vectors vs. Arrays vs. Lists vs. Matrices vs. Data Frames
Upvotes: 1