dyn.load("XDemo.dll") is.loaded("DemoAutoCor") x = rnorm(30,0,1); UseData = x + c( 0, .3 * x[1:29]) + c(0,0, .1 * x[1:28]); ## Creates Some Data OutLength = floor(length(x) / 4) ## Desired Output Length #### Now call to .C() OutPut =.C("DemoAutoCor", OutVec=as.double( vector("numeric", OutLength) ), OutLength = as.integer(OutLength), InputVector = as.double(UseData), InputLength = as.integer(length(UseData)) ); ### Gives the full outputted list() object: OutPut