```{r}
library(matrixStats)
library(SeuratData)
library(Seurat)
pbmc3k.final <- LoadData("pbmc3k", type = "pbmc3k.final")
pmbc.updated = UpdateSeuratObject(object = pbmc3k.final)
pmbc.updated=SCTransform(pmbc.updated)
pmbc.updated=FindNeighbors(pmbc.updated)

pmbc.updated=RunUMAP(pmbc.updated,dims = 1:10)
DimPlot(pmbc.updated,reduction = "umap")
```
```{r}
# Load necessary library
library(ggplot2)
drug_name$mzmean=0.5*drug_name$mzLow+0.5*drug_name$mzHigh
# Loop through each column
for (i in 1:ncol(drug)) {
    # Extract the column
    column_data <- drug[, i]

    # Create a histogram using ggplot2
    p <- ggplot(data.frame(value = column_data), aes(x = value)) +
        geom_histogram(bins = 30, fill = "blue", color = "black") +
        labs(title = paste("Histogram of Column", i),
             x = "Value",
             y = "Frequency")

    # Print the histogram
    print(p)

    # Optionally, save the plot to a file
    # ggsave(paste("histogram_column_", i, ".png", sep = ""), plot = p)
}

```

