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,290 points
13 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,000 points

Related Questions In Data Analytics

0 votes
1 answer

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

A variable name in R programming language ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,690 points
58 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,000 points
39 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,000 points
6 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,000 points
18 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,050 points
19 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,000 points
12 views
0 votes
1 answer

Error: could not find function - R Programming

This error usually occurs when a package ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,000 points
115 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.