R programming logic

0 votes

Below is a character vector in R.

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)}"

Need a logic to get the following:

ggstyle(inputFile)

Nov 16, 2018 in Data Analytics by Ali
• 10,430 points
39 views

1 answer to this question.

0 votes

Use gsub to match the substring that we want to delete and replace it with ''

gsub("[[:punct:]]+function|\\{.*", "", longString)
#[1] "ggstyle(inputFile)"
answered Nov 16, 2018 by Maverick
• 10,040 points

Related Questions In Data Analytics

0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26 in Data Analytics by anonymous
• 31,840 points
110 views
0 votes
1 answer

R programming Web Scraping

Try something like this: library(rvest) library(rvest) library(tidy ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,040 points
102 views
0 votes
1 answer

Expression Computation - R programming

The sequence of ones: cumsum(10^(0:4)) ## [1] ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,040 points
22 views
0 votes
1 answer

Difference between factor and as.factor in R programming

Hey @Ali, as.factor is a wrapper for ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,040 points
342 views
+1 vote
2 answers
0 votes
1 answer
+4 votes
2 answers
0 votes
1 answer

R Programming: matrices

Try this, It will test if a matrix ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 9,870 points
34 views
0 votes
1 answer

Why should I adopt R programming

R Programming is the best mechanism for ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,040 points
31 views
0 votes
2 answers

Error: could not find function - R Programming

Yes, Just like @Maverik said, It happens ...READ MORE

answered Aug 22 in Data Analytics by anonymous
• 31,840 points
4,855 views