openlang

Trouble drawing a correlation chart

Hi folks,

Could somebody explane why the Performance Analytics package's chart.Correlation function fails on the iris data, i made a numeric iris version using lapply and is.numeric

cheers

Tavin

The conversation continues 3

Follow the reasoning
  1. Permalink

    Could you paste what you've tried? We'd need your actual code together with the errors or warnings it produces to understand the problem.

    Copy your code here, placing it inside

    That formats it so we can take a copy, paste it and execute it ourselves .

  2. Permalink

    I can't find any parameter of chart.Correlation that takes that "is.numeric" value. My understanding is that everything must become numeric before calling chart.Correlation. For iris, that means "Species".

    This looks to run correctly:

    flowers <- iris  # I'd rather leave 'irs" unchanged.
    flowers$Species <- as.numeric(flowers$Species)
    chart.Correlation(flowers,
                      histogram = TRUE, method = c("pearson"),
                      pch = 2)

Other sides of the same question

  1. Getting the present time as a seconds timestamp?

    In Dyalog APL, the function ⎕TS provides today's current year, month, day, hours, minutes, seconds and so on, but can I obtai…

    Replies 2Latest activity apl
  2. Swift - Making integers positive

    can an integer be converted to its absolute value? for instance I tried UInt() already, thinking it would turn the Int into a…

    Replies 4Latest activity swift
  3. How R handles repeated arithmetic signs

    I mistakenly put an extra + into my R code and found that it raised no complaint whatsoever. Actually, after trying a few mor…

    Replies 2Latest activity r