Hi,
In the ?cut(), you can specify `labels`.
#or, you can try:
test.df<-read.table(text="
??? Var1 Freq
1??? (0,0.05]? 68
2? (0.05,0.1]? 87
3? (0.1,0.15]? 85
4? (0.15,0.2]? 72
5? (0.2,0.25]? 65
6? (0.25,0.3]? 73
7? (0.3,0.35]? 74
",sep="",header=T,stringsAsFactors=F)
test.df[,1]<-as.numeric(gsub(".*,(.*)]","\\1",test.df[,1]))
test.df
#? Var1 Freq
#1 0.05?? 68
#2 0.10?? 87
#3 0.15?? 85
#4 0.20?? 72
#5 0.25?? 65
#6 0.30?? 73
#7 0.35?? 74
A.K.
----- Original Message -----
From: Wim Kreinen <wkreinen at gmail.com>
To: r-help at r-project.org
Cc:
Sent: Thursday, January 24, 2013 12:39 PM
Subject: [R] From table to data.frame
Hello,
I have a dataframe (test.df) with intervals that were generated by table
(see below). I would prefer a dataframe labeled like this: