/// <summary>
        /// Create an RDate
        /// </summary>
        /// <param name="name">name of the RData instance</param>
        /// <param name="jparent">Parent json.net object</param>
        /// <returns>RData object</returns>
        /// <remarks></remarks>
        public static RData parseDate(String name, JToken jparent)
        {
            RData data = null;

            JToken j = jparent["value"].Value <JToken>();
            JToken f = jparent["format"].Value <JToken>();

            if ((j.Type == JTokenType.Date) || (j.Type == JTokenType.String))
            {
                data = new RDate(name, j.Value <string>(), f.Value <string>());
            }

            return(data);
        }
        private static RData checkEmptyValue(JToken jparent, String type, String rclass, String name)
        {
            RData data = null;

            if (!(jparent["value"] == null))
            {
                return(null);
            }

            if (type == Constants.TYPE_MATRIX)
            {
                if (rclass == Constants.RCLASS_NUMERIC)
                {
                    data = new RNumericMatrix(name, null);
                }
                else if (rclass == Constants.RCLASS_CHARACTER)
                {
                    data = new RStringMatrix(name, null);
                }
                else if (rclass == Constants.RCLASS_BOOLEAN)
                {
                    data = new RBooleanMatrix(name, null);
                }
                else
                {
                    data = new RNumericMatrix(name, null);
                }
            }
            else if (type == Constants.TYPE_VECTOR)
            {
                if (rclass == Constants.RCLASS_NUMERIC)
                {
                    data = new RNumericVector(name, null);
                }
                else if (rclass == Constants.RCLASS_CHARACTER)
                {
                    data = new RStringVector(name, null);
                }
                else if (rclass == Constants.RCLASS_BOOLEAN)
                {
                    data = new RBooleanVector(name, null);
                }
                else if (rclass == Constants.RCLASS_DATE)
                {
                    data = new RDateVector(name, null, "");
                }
                else
                {
                    data = new RNumericVector(name, null);
                }
            }
            else if (type == Constants.TYPE_PRIMITIVE)
            {
                if (rclass == Constants.RCLASS_NUMERIC)
                {
                    data = new RNumeric(name, 0);
                }
                else if (rclass == Constants.RCLASS_CHARACTER)
                {
                    data = new RString(name, null);
                }
                else if (rclass == Constants.RCLASS_BOOLEAN)
                {
                    data = new RBoolean(name, false);
                }
                else
                {
                    data = new RNumeric(name, 0);
                }
            }
            else if (type == Constants.TYPE_DATE)
            {
                data = new RDate(name, null, "");
            }
            else if (type == Constants.TYPE_FACTOR)
            {
                data = new RFactor(name, null);
            }
            else if (type == Constants.TYPE_DATAFRAME)
            {
                data = new RDataFrame(name, null);
            }
            else if (type == Constants.TYPE_LIST)
            {
                data = new RList(name, null);
            }

            return(data);
        }
        private static RData checkEmptyValue(JToken jparent, String type, String rclass, String name)
        {
            RData data = null;

            if (!(jparent["value"] == null))
            {
                return null;
            }

            if (type == Constants.TYPE_MATRIX)
            {
                if (rclass == Constants.RCLASS_NUMERIC)
                {
                    data = new RNumericMatrix(name, null);
                }
                else if (rclass == Constants.RCLASS_CHARACTER)
                {
                    data = new RStringMatrix(name, null);
                }
                else if (rclass == Constants.RCLASS_BOOLEAN)
                {
                    data = new RBooleanMatrix(name, null);
                }
                else
                {
                    data = new RNumericMatrix(name, null);
                }
            }
            else if (type == Constants.TYPE_VECTOR)
            {
                if (rclass == Constants.RCLASS_NUMERIC)
                {
                    data = new RNumericVector(name, null);
                }
                else if (rclass == Constants.RCLASS_CHARACTER)
                {
                    data = new RStringVector(name, null);
                }
                else if (rclass == Constants.RCLASS_BOOLEAN)
                {
                    data = new RBooleanVector(name, null);
                }
                else if (rclass == Constants.RCLASS_DATE)
                {
                    data = new RDateVector(name, null, "");
                }
                else
                {
                    data = new RNumericVector(name, null);
                }
            }
            else if (type == Constants.TYPE_PRIMITIVE)
            {
                if (rclass == Constants.RCLASS_NUMERIC)
                {
                    data = new RNumeric(name, 0);
                }
                else if (rclass == Constants.RCLASS_CHARACTER)
                {
                    data = new RString(name, null);
                }
                else if (rclass == Constants.RCLASS_BOOLEAN)
                {
                    data = new RBoolean(name, false);
                }
                else
                {
                    data = new RNumeric(name, 0);
                }
            }
            else if (type == Constants.TYPE_DATE)
            {
                data = new RDate(name, null, "");
            }
            else if (type == Constants.TYPE_FACTOR)
            {
                data = new RFactor(name, null);
            }
            else if (type == Constants.TYPE_DATAFRAME)
            {
                data = new RDataFrame(name, null);
            }
            else if (type == Constants.TYPE_LIST)
            {
                data = new RList(name, null);
            }

            return data;
        }
        /// <summary>
        /// Create an RDate
        /// </summary>
        /// <param name="name">name of the RData instance</param>
        /// <param name="jparent">Parent json.net object</param>
        /// <returns>RData object</returns>
        /// <remarks></remarks>
        public static RData parseDate(String name, JToken jparent)
        {
            RData data = null;

            JToken j = jparent["value"].Value<JToken>();
            JToken f = jparent["format"].Value<JToken>();
            if ((j.Type == JTokenType.Date) || (j.Type == JTokenType.String))
            {
                data = new RDate(name, j.Value<string>(), f.Value<string>());
            }

            return data;
        }