Posts

R: 'file' must be a character string or connection

Image
I was using the Shiny app in R , and I was trying to read a file using fileInput control, but I faced the following error:   Listening on http://127.0.0.1:3558 Error in read.table(file = file, header = header, sep = sep, quote = quote,  :   'file' must be a character string or connection Problem code: if(is.null(input$file1))       return(NULL)  file <- read.csv(file=input$file1,head=TRUE,sep=",", stringsAsFactors=FALSE) csv <- str(file) Solution: inFile <- input$file1 if (is.null(inFile))       return(NULL)     csv <- read.csv(inFile $datapath , header=TRUE, sep=",") The resolution was to use the datapath property of the input file and not the file itself.

IP Info [version 1.15.12.29]

Image
This tiny utility shows you public and private IP as soon as you open it so you don't need to go to any website such as whatismyip.com to find your current Public IP Address. Size: IP info.zip --> 3.94 KB IP info.exe --> 9.50 KB Download links: 1. Google Drive: https://drive.google.com/file/d/0B_HnjRcH9aTpQmNGUmw3cU5RQ2s/view?usp=sharing 2. MediaFire: http://www.mediafire.com/download/c1zn8yyh7zfsn3w/IP_info.zip 3. Kickass Torrents: https://kat.cr/ip-info-zip-t11825063.html This is a small Windows utility that shows your public and private IP address the moment you open it, so you do not have to visit a site such as whatismyip to look it up. A tiny local tool like this is convenient for quick network checks. As with any downloaded executable, run it only if you trust the source.

Introduction to R (Download PDF)

Image
Download Link: https://drive.google.com/file/d/0B_HnjRcH9aTpNG10ME1raW0zdTA/view?usp=sharing (Click this link to download pdf) This PDF is a part of Introduction to R workshop conducted by Chris Bruno , Dason Kurkiewicz and Adam Loy from Department of Statistics, IOWA State University on 15 July 2010. Reference: http://streaming.stat.iastate.edu/workshops/r-intro/ Breakdown of chapters is as following: 1. Introduction 2. Data Management 3. Graphics 4. Models 5. Programming 6. Advanced Manipulations Reference: http://streaming.stat.iastate.edu/workshops/r-intro/lectures/ This post shares a downloadable PDF introduction to R from a statistics workshop, aimed at newcomers to the language. R is a free environment widely used for statistics, data analysis, and graphics. A guided introduction like this is a good starting point before moving on to packages such as ggplot2 and dplyr for visualization and data wrangling.

Plot histogram in RStudio using Shiny

Image
CODE: # '#' denotes a comment # install.packages("UsingR") uncomment if package is not installed library (UsingR) # install.packages("shiny") uncomment if package is not installed library (shiny) # install.packages("Hmisc") uncomment if package is not installed library (Hmisc) # install.packages("corrplot") uncomment if package is not installed library (corrplot) # getwd() gives the current directory where R looks up for files wd <- getwd() setwd(wd)

'atlbase.h': No such file or directory

Image
Error code: #include <atlbase.h> Error: 1    error C1083: Cannot open include file: 'atlbase.h': No such file or directory 2    IntelliSense: cannot open source file "atlbase.h" This error occurs if you are using atlbase.h file in your program in Visual C++ Express Edition instead of Visual Studio. The reason is express edition does not come with Microsoft Platform SDK as studio does so we need to install it separately and need to modify a couple of lines. Solution: 1. Download and install Windows Server 2003 SP1 Platform SDK from http://www.microsoft.com/en-us/download/details.aspx?id=6510 2. If you have a 64-bit OS/Processor (Intel i5, Windows 7 64-bit) then install PSDK-amd64.exe as other two won't work. 3. Go to your installation directory to edit atlbase.h file, default would be C:\Program Files\Microsoft Platform SDK\Include\atl 4. Make following changes

Database login error in Visual Studio

Image
Error: Cannot open user default database. Login failed. Login failed for user 'abcxyz'. I got this error in my Visual Web Developer 2010 Express. My database named Database1.mdf was not opening and throwing this error.

Memory usage per process in C++

Image
Code: #include <windows.h> #include <stdio.h> #include <psapi.h> void PrintMemoryInfo( DWORD processID ) {     HANDLE hProcess;     PROCESS_MEMORY_COUNTERS pmc;     printf( "\nProcess ID: %u\n", processID );     hProcess = OpenProcess(  PROCESS_QUERY_INFORMATION |         PROCESS_VM_READ,         FALSE, processID );     if (NULL == hProcess)         return;