I'm a newbee to R, I'm not very clear with the basics.Here is a character vector:

longString <- "ggstyle<-function(inputFile {tableMedian=inputFile#plotstyleroutine#thislinesolvestheproblemifthemedianofevennumberofdaysistakenbytakingthevectornumberdayMedVec=round(length(unique(tableMedian$day))/2,0)dayMed=as.numeric(unique(tableMedian$day)[dayMedVec])x=tableMedian[tableMedian$day==dayMed,]p=ggplot(x,aes(x=AGE,y=SCORES))+geom_bar(stat=\"identity\",alpha=1)print(p)}"

I require a logic to grab:

ggstyle(inputFile)

My idea was to grab everything before

<-function as the first vector and everything between function() as a second vector and then finally, combine the two vectors.

But I don't know how to make this work? Any help would be appreciated