[Rcpp-commits] r589 - pkg/src/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 6 09:58:12 CET 2010


Author: romain
Date: 2010-02-06 09:58:07 +0100 (Sat, 06 Feb 2010)
New Revision: 589

Modified:
   pkg/src/Rcpp/as.h
Log:
some doc

Modified: pkg/src/Rcpp/as.h
===================================================================
--- pkg/src/Rcpp/as.h	2010-02-06 08:47:29 UTC (rev 588)
+++ pkg/src/Rcpp/as.h	2010-02-06 08:58:07 UTC (rev 589)
@@ -43,15 +43,83 @@
 	T t(m_sexp);
 	return t ;
 }
+/**
+ * Converts the R object to a bool. 
+ * 
+ * The R object must be either a logical, integer, raw or numeric vector
+ * and must have only one element. An exception is thrown otherwise
+ *
+ * bool can not handle missing values, so NA are converted to false
+ */
 template<> bool 			as<bool>(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a double
+ * 
+ * The R object must be either a logical, integer, raw or numeric vector
+ * and must have only one element. An exception is thrown otherwise
+ */
 template<> double                   	as<double>(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to an int
+ * 
+ * The R object must be either a logical, integer, raw or numeric vector
+ * and must have only one element. An exception is thrown otherwise
+ */
 template<> int                      	as<int>(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a Rbyte
+ * 
+ * The R object must be either a logical, integer, raw or numeric vector
+ * and must have only one element. An exception is thrown otherwise
+ */
 template<> Rbyte                    	as<Rbyte>(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a std::string
+ * 
+ * The R object must be a character vector of length 1. 
+ * An exception is thrown otherwise
+ */
 template<> std::string              	as<std::string>(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a std::vector<int>
+ *
+ * The R object must be a logical, integer, raw or numeric vector
+ */
 template<> std::vector<int>         	as< std::vector<int> >(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a std::vector<double>
+ *
+ * The R object must be a logical, integer, raw ornumeric vector
+ */
 template<> std::vector<double>      	as< std::vector<double> >(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a std::vector<std::string>
+ *
+ * The R object must be a character vector
+ */
 template<> std::vector<std::string> 	as< std::vector<std::string> >(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a std::vector<Rbyte>
+ *
+ * The R object must be a logical, integer, raw or numeric vector
+ */
 template<> std::vector<Rbyte>       	as< std::vector<Rbyte> >(SEXP m_sexp) ;
+
+/**
+ * Converts the R object to a std::vector<Rbyte>
+ *
+ * The R object must be a logical, integer, raw or numeric vector
+ *
+ * since bool can not handle missing values, they are converted to false
+ */
 template<> std::vector<bool>        	as< std::vector<bool> >(SEXP m_sexp) ;
 
 } // Rcpp 



More information about the Rcpp-commits mailing list