Git Product home page Git Product logo

Comments (1)

rrrlw avatar rrrlw commented on May 18, 2024

I would use either read.table from the utils package or one of the read_* functions from the readr package. The exact function you use will depend on the format of your external data file. For instance, if you have a CSV, you would use one of the following blocks of code:

# code block using base R
library(TDAstats)

# read in data (change my_file.csv to your actual file name)
input_data <- read.csv("/home/linda/Desktop/file/my_file.csv")

# select the columns of interest and store in a new data frame
df_data <- input_data[, c("x", "y", "z")]

# convert that data frame to a numeric matrix
mat_data <- as.matrix(df_data)

# calculate persistent homology
homology_output <- calculate_homology(mat_data)
# code block using tidyverse
library(tidyverse)
library(TDAstats)

# read in data (change my_file.csv to your actual file name)
input_data <- read_csv("/home/linda/Desktop/file/my_file.csv")

# select the numeric columns of interest, convert to a matrix, and calculate persistent homology
homology_output <- input_data %>%
  select(x, y, z) %>%
  as.matrix() %>%
  calculate_homology()

Best of luck!

from tdastats.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.