so, i have 2 API'S. I read them and store them in a data frame and when i try to export it to pgadmin4 to a table , i get errors. i couldn't find a solution. Here is my code. My aim is to merge 2 api into a data frame and then store it i a table in pgadmin4. Also, these 2 apis don't have same number of rows, because of which cbind fill is needed, but that doesn't help. I get the errors as "Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 1, 0" above the line of code "json_data1 <- data.frame(json_data1)" and error "Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘dbWriteTable’ for signature ‘"PostgreSQLConnection", "character", "list"’" above the line of code "dbWriteTable(con,"newdatatable", json_data1 )". Any help would be very appreciated, i am struck here
Thank you. it works great. i have some more doubts. is it possible to auto refresh the API's? in the sense, no need to read in a new api everytime, but automatically refresh it?
in my code, i had named something like json file1 and json file2. those are links that contains data in the form of json. is it possible that these links can be auto refreshed and the updated data can be viewed when administrator adds new data into the json file of the link?
You could wrap your script in a function that when run interrogates the website and retrieves the results so that you can do:
mydata <- get_mydata()
, but you can not avoid accessing the "website" if you want to update the results.
However, if the name of the json file to be accessed changes, you should account for that by modifying
the "address" to be fetched. For example by changing the dates in
Alright. Thank you so much. your explanation is greatly helping me. i have one more doubt. i have a shiny app that gives bar graphs based on input selected from user thru drop down menu. many such drop downs are there. they seems to be clumsy, seen on a single page. i want to have radio buttons and select whichever drop down type user wants to see and based on that , the graph, only for that particular drop down is shown.
concerning your last question, I do not know much about shiny. I think you'd be better off by starting a new thread. Consider however that if you do not provide some additional details/examples I do not think that you will get many replies.
so, this is my code, and "mydata1" is a csv file with 2 columns. one column is distributor_name and it has the following data
distributor_name<-data.frame("Chhutu Enterprise" , "Durga Agency", "DeyS Agency House", "S.P Traders") . Next column is outlet_type and it has outlet_type <-data.frame("Grocer","Grocer", "Puja Outlet", "Self Service")
. i am able to show drop downs for specific option chosen by user, but graphs are not being plotted.