Skip to content

Instantly share code, notes, and snippets.

View deshanm's full-sized avatar
👋
Hi

Deshan deshanm

👋
Hi
View GitHub Profile
@deshanm
deshanm / index.js
Created May 4, 2020 22:52
Yup Formik Dynamic Array of Objects
import "./styles.css";
import * as Yup from "yup";
import { ErrorMessage, Field, FieldArray, Form, Formik } from "formik";
import React from "react";
const App = () => (
<div>
@deshanm
deshanm / ex-async.R
Created July 22, 2019 19:35
How to run R Scripts in NodeJS Asynchronously (Rest API)
needs(dplyr)
attach(input[[1]])
return("early returns are ignored")
# output of final expression is returned to node
df %>%
mutate(group = cut(rating, nGroups, ordered = T)) %>%
group_by(group) %>%
summarize_all(funs_(fxn)) %>%
needs(dplyr)
attach(input[[1]])
return("early returns are ignored")
# output of final expression is returned to node
df %>%
mutate(group = cut(rating, nGroups, ordered = T)) %>%
group_by(group) %>%
summarize_all(funs_(fxn)) %>%