Forum Discussion
¿Cómo ejecutar una transformación de script de R en una consulta existente?
Es mi culpa. Ha pasado un tiempo. Debe enviar la trama de datos resultante a la salida
• 'dataset' contiene los datos de entrada para este script
dataset$newcolumn <- dataset$Number * 2
salida <- dataset
Hice una consulta de prueba, si te interesa.
Dejar
Source á Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitWJVnICsozALGcgy1gpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t á ((texto de tipo) meta [Serialized.Text ? true]) en la tabla de tipos [Carta á_t, Número _t]).
"Tipo modificado" ? Tabla.TransformColumnTypes(Fuente, ?"Carta", escriba texto, "Número", Int64.Tipo, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . . . . . . . . . . . . . . . . . . .
"Ejecutar script r" á R.Execute("' 'dataset' contiene los datos de entrada para este script (lf)dataset$newcolumn <- dataset$Number * 2'(lf)output <- dataset",[dataset-"Changed Type"]),
"""output""" á "Ejecutar script R" , [Nombre" "salida"][Valor]
En
""salida"""
Si esto funciona para usted, por favor márquelo como solución. Los felicitaciones también son apreciados. Por favor, avísame si no.
saludos
palmadita
Hola @mahoneypat,
Intenté esto y todavía tengo el mismo error. Me preguntaba si esto se debe a que fusioné esta consulta con otra anterior, así que la probé con una consulta diferente que no había fusionado anteriormente en su lugar.
Esta vez recibí un mensaje que decía "Se requiere información sobre la privacidad de los datos".
Hice clic en "Ignorar comprobaciones de nivel de privacidad para este archivo. Ignorar las comprobaciones de nivel de privacidad podría exponer datos confidenciales o confidenciales a una persona no autorizada." y haga clic en "Guardar" (No podría hacer esto para datos empresariales debido a problemas de seguridad, pero lo probé con fines de prueba.)
Luego recibí un mensaje de error diferente que comienza con (no puedo agregar todo el asunto ya que supera los 20.000 caracteres):
Tipo de comentario:
Frown (Error)
Mensaje de error:
Referencia de objeto no establecida en una instancia de un objeto.
Rastreo de pila:
Microsoft.Mashup.Evaluator.Interface.ErrorException: referencia de objeto no establecida en una instancia de un objeto. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: referencia de objeto no establecida en una instancia de un objeto. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: referencia de objeto no establecida en una instancia de un objeto. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: referencia de objeto no establecida en una instancia de un objeto. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: referencia de objeto no establecida en una instancia de un objeto. ---> System.NullReferenceException: referencia de objeto no establecida en una instancia de un objeto. ---> System.NullReferenceException: referencia de objeto no establecida en una instancia de un objeto.
en Microsoft.PowerBI.Radio.RConnection.get_ServerVersion()
en Microsoft.Mashup.Engine1.Library.Common.DelegatingDbConnection.get_ServerVersion()
en Microsoft.Mashup.Engine1.Library.Common.DelegatingDbConnection.get_ServerVersion()
en Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.LoadServerVersion()
en Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.LoadCachedServerVersion()
en Microsoft.Mashup.Engine1.Library.Common.DbEnvironment.CreateConnection()
en Microsoft.Mashup.Engine1.Library.Common.DbValueBuilder.ConnectionReader..ctor(DbEnvironment environment, Func'2 readerWrapper)
en Microsoft.Mashup.Engine1.Library.Common.NativeQueryTableValue.Initialize()
en Microsoft.Mashup.Engine1.Library.Common.NativeQueryTableValue.EnsureInitialized()
en Microsoft.Mashup.Engine1.Library.Common.NativeQueryTableValue.GetEnumerator()
en Microsoft.Mashup.Engine1.Runtime.TableValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.TableValue.get_Item(Clave de valor)
en Microsoft.Mashup.Engine1.Runtime.Library.List.ElementWithListCheckFunctionValue.Invoke(Value collection, Value key)
en Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction1.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(campo String)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction1.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.Instruction.Execute(MembersFrame1& frame, Instruction[] instructions)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(campo String)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(Value frame)
en Microsoft.Mashup.Engine1.Language.IfInstruction.Execute(Value frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(Value frame)
en Microsoft.Mashup.Engine1.Language.RuntimeFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(campo String)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue2.Invoke(Value arg0, Value arg1)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue2.Invoke(Value arg0, Value arg1)
en Microsoft.Mashup.Engine1.Runtime.FunctionValue.MetaTypeFunctionValue.Invoke(Value arg0, Value arg1)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue2.Invoke(Value arg0, Value arg1)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame2& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue2.Invoke(Value arg0, Value arg1)
en Microsoft.Mashup.Engine1.Runtime.FunctionValue.Invoke(Value[] args)
en Microsoft.Mashup.Engine1.Runtime.FunctionValue.MetaTypeFunctionValue.Invoke(Value[] args)
en Microsoft.Mashup.Engine1.Runtime.Extensibility.HostRelinkingFunctionValue.ExtensionFunctionValue.InvokeN(Value[] args)
en Microsoft.Mashup.Engine1.Runtime.NativeFunctionValueN.Invoke(Value[] args)
en Microsoft.Mashup.Engine1.Runtime.NativeFunctionValueN.Invoke(Value arg0, Value arg1)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(campo String)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(clave de valor)
en Microsoft.Mashup.Engine1.Runtime.Library.Linker.BindFunctionValue.TypedInvoke(RecordValue environment, Value section, TextValue name)
en Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue3'4.Invoke(Value arg0, Value arg1, Value arg2)
en Microsoft.Mashup.Engine1.Runtime.FunctionValue.Invoke(Value[] args)
en Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction.Execute(MembersFrame0& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
en Microsoft.Mashup.Engine1.Language.ListInstruction.RuntimeListValue.Force(Int32 index)
en Microsoft.Mashup.Engine1.Language.ListInstruction.RuntimeListValue.get_Item(Int32 index)
en Microsoft.Mashup.Engine1.Runtime.ListValue.get_Item(clave de valor)
en Microsoft.Mashup.Engine1.Runtime.Library.List.ElementWithListCheckFunctionValue.Invoke(Value collection, Value key)
en Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(campo String)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.Instruction.ExecuteCondition(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.ExecuteCondition(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.IfInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(int32 index)
en Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(int32 index)
en Microsoft.Mashup.Engine1.Runtime.RecordValue.get_Item(campo String)
en Microsoft.Mashup.Engine1.Language.FieldAccessInstruction.Execute(MembersFrame0& frame)
en Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
en Microsoft.Mashup.Engine1.Runtime.FunctionValue.Invoke(Value[] args)
en Microsoft.Mashup.Engine1.Engine.Microsoft.Mashup.Engine.Interface.IEngine.Invoke(IValue function, IValue[] argumentos)
en Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parámetros, Action'1 callback)
--- fin del seguimiento de la pila de excepciones interna ---
¿Alguna idea de lo que esto significa?
- mahoneypat6 years ago
Microsoft Employee
Por favor, vea este post.
http://officeusers.blogspot.com/2018/06/using-r-in-power-bi-object-reference.html
¿Está utilizando 32 bits R Studio?
saludos
palmadita