Home » Posts tagged 'tutorial' (Page 2)
Tag Archives: tutorial
Using R with MySQL #rstats
A brief tutorial to working with R and MySQL. MySQL belongs to Oracle is one of the most widely used databases now.
http://www.mysql.com/downloads/mysql/ or (http://www.mysql.com/downloads/mirror.php?id=403831)
Click Install -use default options, remember to note down the password=XX
2.Download the ODBC connector from http://www.mysql.com/downloads/connector/odbc/5.1.htmlThe Data Sources (ODBC) can be located from the Control Panel in Windows7
Install ODBC Connector by double clicking the .msi file downloaded in Step 2-
Check this screenshot in ODBC Connectors to verify-
Note this is the Drivers tab in ODBC Data Source Administrator
Click the System DSN and Configure MySQL using the add button
Test the connection
Click OK to finish this step.
Click the User DSN tab (and repeating the step immediately above -Add, and Configure the connection using options The user is root, the TCP/IP Server is local host, use the same password in Step 1 and the Database is MySQL , Test the connection and OK to add the connection
3. Download the MySQL workbench from http://www.mysql.com/downloads/workbench/
This is very helpful to configuring the database
http://www.mysql.com/downloads/mirror.php?id=403983#mirrors
Create a new table using the options in the screenshots below
Open Connection
You can create a new table using the options as below,
Once created you can also add new variables (using the Columns Tab)
MySQL allows you create new columns very easily
The SQL commands are automatically generated.
Click Apply to execute the changes to the Database.
Now we start R
Type the commands in the screenshot below to create a connection to the Database in MySQL
> library(RODBC)
> odbcDataSources()
> ajay=odbcConnect(“MySQL”,uid=”root”,pwd=”XX”)
> ajay
> sqlTables(ajay)
>tested=sqlFetch(ajay,”host”)
Note- this is a brief tutorial for beginners without getting into too many complexities of database administration and management, to start using R and MySQL.
Rcpp Workshop in San Francisco Oct 8th
Rcpp Workshop in San Francisco Oct 8th
Following the successful one-day master class on Rcpp preceding this year’s R/Finance conference, a full-day master class on Rcpp and related topics which will be held on Saturday, October 8, in San Francisco.
Join Dirk Eddelbuettel for six hours of detailed and hands-on instructions and discussions aroundRcpp, inline, RInside, RcppArmadillo, RcppGSL, RcppEigen and other packages—in an intimate small-group setting.
The full-day format allows combining an introductory morning session with a more advanced afternoon session while leaving room for sufficient breaks. We plan on having about six hours of instructions, a one-hour lunch break and two half-hour coffee breaks (and lunch and refreshments will be provided).
Morning session: “A Hands-on Introduction to R and C++”
The morning session will provide a practical introduction to the Rcpp package (and other related packages). The focus will be on simple and straightforward applications of Rcpp in order to extend R and/or to significantly accelerate the execution of simple functions.
The tutorial will cover the inline package which permits embedding of self-contained C, C++ or FORTRAN code in R scripts. We will also discuss RInside, to easily embed the R engine code in C++ applications, as well as standard Rcpp extension packages such as RcppArmadillo and RcppEigen for linear algebra (via highly expressive templated C++ libraries) and RcppGSL.
Afternoon session: “Advanced R and C++ Topics”
The afternoon tutorial will provide a hands-on introduction to more advanced Rcpp features. It will cover topics such as writing packages that use Rcpp, how Rcpp modules and the new R ReferenceClasses interact, and how Rcpp sugar lets us write C++ code that is often as expressive as R code. Another possible topic, time permitting, may be writing glue code to extend Rcpp to other C++ projects.
We also expect to leave some time to discuss problems brought by the class participants.
October 8, 2011 – San Franciso
AMA Executive Conference Center
@ the Marriott Hotel
55 4th Street, 2nd Level
San Francisco, CA 94103
Tel. 415-442-6770
Instructor Bio
| Dirk E has been contributing packages to CRAN for nearly a decade. Among these are RQuantLib, digest, littler, random, RPostgreSQL, as well the Rcpp family of packages comprising Rcpp, RInside, RcppClassic, RcppExamples, RcppDE, RcppArmadillo and RcppEigen. He maintains the CRAN Task Views for Finance as well as High-Performance Computing, and is a founding co-organiser of the annual R / Finance conferences in Chicago. He has Ph.D. in Financial Econometrics from EHESS (Paris), and works in Chicago as a Quantitative Strategist. |
Google Plus API- statistical text mining anyone
For the past year and two I have noticed a lot of statistical analysis using #rstats /R on unstructured text generated in real time by the social network Twitter. From an analytic point of view , Google Plus is an interesting social network , as it is a social network that is new and arrived after the analytic tools are relatively refined. It is thus an interesting use case for evolution of people behavior measured globally AFTER analytic tools in text mining are evolved and we can thus measure how people behave and that behavior varies as the social network and its user interface evolves.
And it would also be a nice benchmark to do sentiment analysis across multiple social networks.
Some interesting use cases of using Twitter that have been used in R.
- Using R to search Twitter for analysis
- Text Data Mining With Twitter And R
- TWITTER FROM R… SURE, WHY NOT!
- A package called TwitteR
- slides from my R tutorial on Twitter text mining #rstats
- Generating graphs of retweets and @-messages on Twitter using R and Gephi

The Console lets you see and manage the following project information:
- Activated APIs - Activate one or more APIs to enable traffic monitoring, filtering, and billing, and API-specific pages for your project. Read more about activating APIs here.
- Traffic information - The Console reports traffic information for each activated API. Additionally, you can cap or filter usage by API. Read more about traffic reporting and request filtering here.
- Billing information - When you activate billing, your activated APIs can exceed the courtesy usage quota. Usage fees are billed to the Google Checkout account that you specify. Read more about billing here.
- Project keys - Each project is identified by either an API key or an OAuth 2.0 token. Use this key/token in your API requests to identify the project, in order to record usage data, enforce your filtering restrictions, and bill usage to the proper project. You can use the Console to generate or revoke API keys or OAuth 2.0 certificates to use in your application. Read more about keys here.
- Team members - You can specify additional members with read, write, or ownership access to this project’s Console page. Read more about team members here.
| Google+ API | Courtesy limit: 1,000 queries/day |
|---|
Effective limits:
| API | Per-User Limit | Used | Courtesy Limit | |
|---|---|---|---|---|
| Google+ API | 5.0 requests/second/user | 0% | 1,000 queries/day |
API Calls
GET https://www.googleapis.com/plus/v1/people/userId
Common Parameters
Different API methods require parameters to be passed either as part of the URL path or as query parameters. Additionally, there are a few parameters that are common to all API endpoints. These are all passed as optional query parameters.
|
|
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Data Formats
Resources in the Google+ API are represented using JSON data formats. For example, retrieving a user’s profile may result in a response like:
{
"kind": "plus#person",
"id": "118051310819094153327",
"displayName": "Chirag Shah",
"url": "https://plus.google.com/118051310819094153327",
"image": {
"url": "https://lh5.googleusercontent.com/-XnZDEoiF09Y/AAAAAAAAAAI/AAAAAAAAYCI/7fow4a2UTMU/photo.jpg"
}
}
Common Properties
While each type of resource will have its own unique representation, there are a number of common properties that are found in almost all resource representations.
|
|
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Pagination
In requests that can respond with potentially large collections, such as Activities list, each response contains a limited number of items, set by maxResults(default: 20). Each response also contains a nextPageToken property. To obtain the next page of items, you pass this value of nextPageToken to the pageTokenproperty of the next request. Repeat this process to page through the full collection.
For example, calling Activities list returns a response with nextPageToken:
{
"kind": "plus#activityFeed",
"title": "Plus Public Activities Feed",
"nextPageToken": "CKaEL",
"items": [
{
"kind": "plus#activity",
"id": "123456789",
...
},
...
]
...
}
To get the next page of activities, pass the value of this token in with your next Activities list request:
https://www.googleapis.com/plus/v1/people/me/activities/public?pageToken=CKaEL
As before, the response to this request includes nextPageToken, which you can pass in to get the next page of results. You can continue this cycle to get new pages — for the last page, “nextPageToken” will be absent.
Youtube's variance in interface/s for sharing
Youtube seems to have a different interface for sharing a channel, a playlist or an individual song. Also it seems to be missing out on revenue from Itunes (or maybe it isnt). and it seems to promoting Facebook and Twitter to the expense of other social media sharing buttons which can be only seen when you click share more (or maybe the buttons/social media channels change based on sharing activity analytics
)
on a slightly different note read my techie tutorial on boosting your youtube channel views
http://decisionstats.com/2010/09/10/creating-an-anonymous-bot/
Creating an Anonymous Bot
See the following interface snapshots/views-
Related Articles
- Optimizing Your Brands YouTube Channel (ignitesocialmedia.com)
- 7 Little Known Tricks That Will Get You More YouTube Views (socialtimes.com)
- Youtube Channel (nmtp06fauzank.wordpress.com)
- YouTube Obsessed! (valerieraynerants.wordpress.com)







