ClearMetaData: Clear specified metadata columns from a PRecording or...

ClearMetaDataR Documentation

Clear specified metadata columns from a PRecording or PCollection object

Description

Clears the specified columns from the MetaData slot of a PRecording object.

Usage

ClearMetaData(
  X,
  columns = try(colnames(GetMetaData(X)), silent = T),
  Verbose = T
)

Arguments

X

A PRecording or PCollection object

columns

A character vector specifying the columns to clear. Defaults to all columns in the MetaData slot.

Verbose

Logical indicating whether to display warnings for non-existing columns. Defaults to TRUE.

Details

This method clears the specified columns from the MetaData slot of a PRecording or PCollection object. If all columns are cleared, the MetaData slot and the associated .MetaDataFx slot are reset to empty values. If only specific columns are cleared, the corresponding columns in the MetaData slot are removed.

Value

The modified PRecording or PCollection object with the specified columns cleared from the MetaData slot.

Functions

  • ClearMetaData: This method clears the specified columns from the MetaData slot of a PRecording object.

See Also

PRecording PCollection AddMetaData

Examples

# Create a PRecording object with MetaData
data("PRecording")
# add two columns of metadata
SampleData<-AddMetaData(SampleData,1:length(GetSweepNames(SampleData)),"ID1")
SampleData<-AddMetaData(SampleData,length(GetSweepNames(SampleData)):1,"ID2")
SampleData<-AddMetaData(SampleData,length(GetSweepNames(SampleData)):1,"ID3")
SampleData

# Clear the "ID1" and "ID2" columns from the MetaData slot
cleared_SampleData <- ClearMetaData(SampleData, columns = c("ID1", "ID2"))
cleared_SampleData

# Clear all columns from the MetaData slot
cleared_SampleData2 <- ClearMetaData(SampleData)
cleared_SampleData2


moritzlindner/PatchMasteR documentation built on April 30, 2024, 1:52 a.m.