--- export_data_r.php.~1~	2009-07-21 11:30:33.000000000 -0300
+++ export_data_r.php	2009-12-16 21:50:06.000000000 -0200
@@ -30,7 +30,7 @@
  * Optimization opportunities remain in the VALUE LABELS section, which runs a query / column
  */
 
-$length_varlabel = '255'; // Set the max text length of Variable Labels
+$length_varlabel = '25500'; // Set the max text length of Variable Labels
 $headerComment = '';
 $tempFile = '';
 
@@ -160,7 +160,7 @@
 	 * be sent to the client.
 	 */
 	echo $headerComment;
-	echo "data=read.table(\"survey_".$surveyid."_data_file.csv\", sep=\",\", quote = \"'\", na.strings=\"\")\n names(data)=paste(\"V\",1:dim(data)[2],sep=\"\")\n";
+	echo "data=read.table(\"survey_".$surveyid."_data_file.csv\", sep=\",\", quote = \"'\", na.strings=\"\")\n names(data)=paste(\"V\",1:dim(data)[2],sep=\"\", stringAsFactors=FALSE)\n";
 	foreach ($fields as $field){
 		if($field['SPSStype'] == 'DATETIME23.2') $field['size']='';
 		if($field['LStype'] == 'N' || $field['LStype']=='K') {
@@ -236,7 +236,7 @@
 			}
 		}
 	}
-	echo "NA); names(data)= v.names[-length(v.names)]\nprint(str(data))\n";
+	echo "NA); names(data)= v.names[-length(v.names)]\nrm(v.names)\n";
 	echo $errors;
 	exit;
 }
