R if statement about a web page [closed] - r

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I know I can open a web page from R using "shell.exec".
But I want to write a loop that opens the webpage only if the webpage
maintains a condition, for a collection of websites.
It's a collection of websites that have "value=somenumber" in their address,
and I want R to open only those that "somenumber" actually have some data.
Numbers that don't have data don't return an error page, but just a page with no data.
The thing is, it's involving like html elements that I need to write in the condition...
is such thing possible?

I would use the stringr library's str_detect
http://cran.r-project.org/web/packages/stringr/stringr.pdf#page.7
Assuming you have a list of the urls. I would just pass that list to the function and if it returns true then do your thing.
str_detect(urlList,"value=[:digit:]")

Here's an approach that uses the more portable browseURL and grep:
x <- readLines(n=3)
http://stackoverflow.com/questions/23840523/check-if-os-is-solaris
http://stackoverflow.com/questions/23817341/faster-i-j-matrix-cell-fill
http://stackoverflow.com/questions/7863710/correlating-word-proximity
sapply(grep("/238", x, value=TRUE), browseURL)

Related

How to find and replace string in multiple word (.docx) files using R programming without changing it's original format [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have many word document files in which i need to change few letters which are common in all files. I want to make a Script for replacing the text in all files once. I am using windows machine and R is installed. Suggest me even if you have any other way of doing it.
This files are microsoft word document files and stored in one folder. I have code which get data into R list and find and replace the text. But it creates the file with changed format.
Please suggest me a better way.
I think you are asking if a package exists that can deal with MS Word file? Yes. It does. It is on CRAN: https://cran.r-project.org/web/packages/officer/index.html.

How to automate the process of generating daily report from firebase? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
For example, to automate the process of producing a daily report for selected events and the duration of time that unique users spend on some specific event. And it is even better if I can customize the reporting information and have it generated in excel sheet automatically. Any suggestions or ideas would be much appreciated.
You could use a Cloud Function to generate you excel report, for example by using excel4node (https://www.npmjs.com/package/excel4node)
And to call this Cloud Function regularly, you have to trigger it via http through a cron-job.
Have a look at:
https://firebase.google.com/docs/functions/http-events).
and
https://www.youtube.com/watch?v=CbE2PzvAMxA
Note: What works quite well too is to generate some PDFs via the Cloud Function, using pdfmake.

Data confidentiality in R [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm considering using R in my work. Primarily I am interested in ggplot2, dplyr and tidyr, probably using the RStudio environment.
I deal with a lot of sensitive educational data, such as names, dates of birth etc and could only only use R at work if I knew the data were safe.
Will my data be kept private/confidential or is it shared in any way?
By default, data or code is not shared to the outside world. This may not hold for cases including but not confined to:
when you are using (online) version control
if you are pushing a report to RPubs repository
using R on a server, which may be accessible to third parties

Proper Coding Techniques in R [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am writing an R code that has many different functions that eventually I will want to use all together on different data sets.
As I keep building functions it seems to be getting harder to keep track of everything in my script.
My question is, is it proper R coding to break functions into separate R Scripts or should it all be in one massive script?
Thank you for your help. This is my first time trying to code something this large!
-B
Yes, you can store your functions in multiple R scripts.
If you need to call them, you can use source().
For eg:
Say you have func1 , func2 saved in myfunc.R.
To call them,
source('myfunc.R')
#other codes
func1()
func2()
As to whether this approach is recommended, depends on your project requirements.
Alternatively, you can consider packaging them as recommended by Richard.

Create report in ASPX.NET by passing value? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Can you please direct me to a tutorial or other resource for accomplishing the following:
Index page lists 50 states. Onlick of a state Y, the report page (report.aspx) will display info related to state Y, pulled from database.mdb, interspersed in HTML text.
I am not even sure what the terms and controls I need to be working with.
Thank you.
UncleJune
Do you know how to create the report? That is the first step. After that it is just a matter of passing the required parameter from one page to the next. Several methods can be used to do this: Response.Redirect/Request.QueryString, session variable, etc.
This tutorial might help you:
Using the ASP.NET 2.0 ReportViewer in Local Mode
Dynamic reports with Microsoft local report engine

Resources