none
Problem with output parameter in publishService function RRS feed

  • Question

  • Hello everyone !

    I have some problem with output parameter in publishService function:

    Function example:

    testf<-function(a,b,c,d,e){
      df<-data.frame(val1=a,val2=b,val3=c,val4=d)
      res<-df+e
      return(res)

    }

    Deployment:

    api<-publishService(
      'testfunc',
      code = testf,
      inputs = list(a='numeric',b='numeric',c='numeric',d='numeric',e='numeric'),
      outputs = list(val1='integer', val2='integer', val3='integer', val4='integer' ),
      v = 'v1.0.0',
      serviceType='Script'

    )

    Results:

    $outputParameters
    $outputParameters$val1
    $outputParameters$val1$key
    [1] "val1"

    $outputParameters$val1$value
    $outputParameters$val1$value[[1]]
    [1] 7

    $outputParameters$val2
    NULL

    $outputParameters$val3
    NULL

    $outputParameters$val4
    NULL

    Why val2, val3, val4 are NULL ?

    Thanl you in advance !

    Monday, January 22, 2018 9:44 AM

Answers

  • may be you should try

    • outputs = list(result = "data.frame" )
    • print(results$output("result"))
    • Marked as answer by ANSHC Monday, March 12, 2018 12:32 PM
    Tuesday, February 13, 2018 7:03 AM

All replies

  • may be you should try

    • outputs = list(result = "data.frame" )
    • print(results$output("result"))
    • Marked as answer by ANSHC Monday, March 12, 2018 12:32 PM
    Tuesday, February 13, 2018 7:03 AM
  • Thank You, I know about this option but I want val1='integer', val2='integer', val3='integer', val4='integer'  as it was in Azure ML studio )
    Monday, March 12, 2018 12:32 PM