Thursday 23 April 2020

How do I merge Rows in R?

Q: How do I merge rows in R?

A: Tidyverse's summarize can be use. Sample below.

Requirement: Remove duplicates and merge data (rows) at the same time.

Sample data


Expected output after merging


Output when we use Excel's Remove Duplicates. Data is lost


Output using R, we get the expected output


Code:

library(tidyverse)

library(readxl)

sampleContainer<-read_excel("SampleContainers.xlsx")

cleanData<-sampleContainer %>%

  group_by(ReferenceNumber, ContainerNumber) %>%

  summarize(lastPullOutadvise=first(PullOutAdvice, order_by = PullOutAdvice),

            lastPullOutCY=first(PullOutCY, order_by = PullOutCY ))

I'm using vision to click but nothing happens?

Q: I'm using vision to click but nothing happens?

A: You may have encountered an error. The error message will not  appear while Tagui is running. Instead, it will show in the tagui.log file in the tagui.sikuli folder. Stop the program and open the file instead. Also, ensure you have Java 64 installed. Sikuli does not work with 32-bit Java.


Recording actions in Chrome

Q: How do I record my actions in Chrome?

A: Please follow the steps below


  1. Add Extension TagUI Web Automation to Chrome
  2. To start recording, click the TagUI icon and click START
  3. Perform the actions you need to record
  4. Once done, click the TagUI icon again and click STOP
  5. Then click EXPORT
Note that the recording is not perfect. The script will still need to be manually edited. 







Running TagUI Live

Q: How do I run TagUI live, not in the background (headless)?

A: add "chrome" after the script