我正在尝试在CRAN中安装一个软件包,其中一个依赖项会抛出此错误:
namespace Newtonsoft.Json
{
public class TestConverter : JsonConverter
{
#region Overrides of JsonConverter
public override bool CanWrite { get { return false; } }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
List<object> resultado = new List<object>();
string propertyName = reader.Value as string;
while (reader.Read())
{
object value = null;
switch (reader.TokenType)
{
case JsonToken.Integer:
value = Convert.ToInt32(reader.Value);
resultado.Add(value);
break;
case JsonToken.Float:
value = Convert.ToDecimal(reader.Value);
resultado.Add(value);
break;
case JsonToken.String:
value = Convert.ToString(reader.Value);
resultado.Add(value);
break;
case JsonToken.Boolean:
value = Convert.ToBoolean(reader.Value);
resultado.Add(value);
break;
case JsonToken.Null:
value = null;
resultado.Add(value);
break;
case JsonToken.Date:
value = Convert.ToDateTime(reader.Value);
resultado.Add(value);
break;
case JsonToken.Bytes:
value = Convert.ToByte(reader.Value);
resultado.Add(value);
break;
default:
Console.WriteLine("Default case");
Console.WriteLine(reader.TokenType.ToString());
break;
}
}
return resultado.ToArray();
}
public override bool CanConvert(Type objectType)
{
return objectType == typeof(object[]);
}
#endregion
}
}
这是在Linux 12.04.5 LTS上,
R版本3.2.5
答案 0 :(得分:2)
原来你可以用
来解决这个问题install.packages('scales')