I have some data from a FACS (fluorescent activated cell sorting) experiment that I want to analyze using R. The problem is that the FACS software has a weird output and basically puts all the characteristics in one column with a "-" in between them.
Example: clone 9_+b_004.fcs/Single cells/red vs. green clone 9_+T_004.fcs/Single cells/red vs. green clone 10_+b_004.fcs/Single cells/red vs. green
and so on
What I need for my analysis are new columns. For example a column named "Clone" with a variable "clone 9" if there is clone 9 in the original column, or "clone 10" if there is clone 10 in the original column. And also a column "Added compound" with variables such as "TGFb" if there's "+b" in the original column, and "Tamoxifen" if there is "+T" etc...
The problem is that I have no idea how to create those columns. I've tried several different codes and combinations (grepl, replace, mutate, to name a few) but nothing has worked so far. Because I need multiple new columns, I can't just replace the original column without duplicating.
Hi @DaphneLM, if you could post a small sample of your data (a table of at most 50 rows, and maybe 6-10 columns), that would be very helpful -- is your data in a data frame?
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: