Hello I'm new with R and I'm trying to create a new column which contains the mean of other 3 columns already existing. This is the code I wrote:
#Open file
All_columns<-read.csv('vCAFs_metascape_all columns.csv')
#> Warning in file(file, "rt"): cannot open file 'vCAFs_metascape_all columns.csv':
#> No such file or directory
#> Error in file(file, "rt"): cannot open the connection
datapasta::df_paste(head(All_columns,5))
#> Error in head(All_columns, 5): object 'All_columns' not found
#Selected columns
Selected_columns<-All_columns%>%
select(logFC_1vs2,logFC_1vs3,logFC_1vs4)
#> Error in All_columns %>% select(logFC_1vs2, logFC_1vs3, logFC_1vs4): could not find function "%>%"
#Add new column
Avg_column<-mutate(Selected_columns,avg=rowMeans(select(Selected_columns,logFC_1vs2,logFC_1vs4)))
#> Error in mutate(Selected_columns, avg = rowMeans(select(Selected_columns, : could not find function "mutate"
It's great that you've shown us a photo of your data, but it will be easier for people to help you if you include a code snippet that creates some fake data that we can put directly into R and play around with to see what's not working.