Comments (1)
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 (19)
- real-world illustration HOT 10
- Return persistent homology as data frame instead of matrix HOT 1
- limit of the filtration HOT 2
- phom.dist does not calculate wasserstein distance HOT 1
- Support for other field coefficients HOT 6
- Add stop points in wrapped C++ code HOT 1
- allow `calculate_homology` to return data frames HOT 4
- fixed coordinates for persistence plot? HOT 1
- Change plot_barcode x-axis label
- update contribution guidelines + code of conduct
- move over calculate_homology functionality to ripserr HOT 1
- calculate_homology results HOT 4
- inspection methods for test output
- Distance measure used by phom.dist() HOT 3
- diagonal missing from modified persistence plot HOT 1
- depend on R v3.3 instead of v3.4? HOT 1
- Suggestion for improving the vignettes HOT 3
- stat and geom layers HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tdastats.