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

Counting the number of elements in a list and then taking the counting as a list in R

$
0
0

I have a vector:

x <- c(0.8,1.0,661.7,661.8,661.9,662.3,662.6,662.7,663.3,663.6,663.7)

I have used function as.data.frame(x) to make following data frame:

       X1
1      0.8
2      1.0
3    661.7
4    661.8
5    661.9
6    662.3
7    662.6
8    662.7
9    663.3
10   663.6
11   663.7

How can I take the list of labels for each element?

i.e x0 <- c(1,2,3,4,5,6,7,8,9,10,11)


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>