Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

S-plus question about length of data

  1. Mar 24, 2009 #1
    Hello, I'm trying to figure out how to program the Exponential Integral function, and then make it compute values for a vector of data.

    I have this:
    Code (Text):

    expint <- function(s){
         integrand <- function(x) {exp(x)/x}
         integrate(integrand, lower = -Inf, upper = s)$integral
    }
     
    if I put expint(-1) then it works, but it doesn't work if I put expint(vectorofvalues), it gives me the following error:

    Warning messages:
    1: Condition has 72 elements: only the first used in: e1 && e2
    2: Condition has 72 elements: only the first used in: e1 || e2
    Problem in bound + (sgn * (1 - nodes))/nodes: length of longer operand (72) should be a multiple of length of shorter (15)

    Anyone know what I need to change for it to work with vectors?
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: S-plus question about length of data
  1. Question about latex (Replies: 7)

  2. Question about LaTeX (Replies: 4)

  3. Question About Latex (Replies: 3)

Loading...