Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206571

How could you show the same vector by different columns using DT::datatable? [closed]

$
0
0

Using this coding:

fruits <- c("Pineapple","Strawberry","Melon","Banana","Passion Fruit","Apple","Papaya","Avocado","Orange","Kiwi","Blackberrie","Apricot","Blueberrie","Carambola","Cherry","Clementine","Coconut","Guava","Mango","Nectarine","Peach")
fruits <- as.data.frame(fruits)
DT::datatable(fruits)

I get an output like this: fruits_DT

But I want it to be shown in more than one column, hopefully the whole fruits vector being shown in one only table, something like this (just displaying more of fruits with the accurate numbers and fruit name values - not the same row, did it like this for easily sampling of wished output): fruits_DT_wannabe

This example is for the question only, real data has 1367 words. I meant to look for displaying the same variable in more than one column in the table. Like showing 3 columns instead of only one but them all being same fruit vector. Showing from 1 to 5 in the first column, 6 to 10 in the second one and 11 to 15 in the third one.


Viewing all articles
Browse latest Browse all 206571

Trending Articles