We have been using many built-in R functions throughout the lessons.
After you start using R more, you will reach the point when you will want to create reusable sections of statements.
Functions are simply a named group of R expressions that are considered an R object of type function().
Input values or function arguments are passed to functions by value. Each argument is either matched with the function definition by position...
User Profile
Collapse
-
Lesson 5 (part2) – r programming structures
-
Lesson 5 (part1) – r programming structures
The programming structures that we will examine include: control flow statements and user defined functions.
In previous lessons we were either performing summary or descriptive statistics across single variables, but in this lesson we will examine the interrelationsh ips between variables. Interrelationsh ip analysis comes in different forms and in this lesson we will examine covariance, correlation, and linear regression techniques.
... -
Lesson 4 (part2) – data management and visualization
Sorting data in a vector is quite easy in R. You simply pass the vector to the sort function and new sorted vector is generated.
The default sort order is ascending, but this can be changed using the argument decreasing=TRUE .
However, in our scenario the data is not in a vector, it is in a data frame. Let's examine how we sort data stored contained in a data frame.
The data frame n.2010 contains three columns: Year, Name and... -
Lesson 4 (part1) – data management and visualization
In this lesson we will learn how to import external data from files into R. We will also learn how to export, or write, the data to files if needed.
Once we have our data loaded into memory we can perform data filtering or querying to focus on key aspects of our data set.
We will also learn how to reorder our data within data frames and finally we will explore data visualization techniques.
R provides extensive data visualization... -
Lesson 3 – data types and structures in r
Welcome to the lesson on R data structures.
To perform any meaningful data analysis we need to collect our data into R data structures.
In this lesson we will explore the most frequently used data types and data structures.
R can be used to analyze many different forms of data. We will explore the built-in data types of R.
Data analysis usually requires an examination of large sets of similar data.
In this... -
Lesson 2 – getting started with r (console and expressions)
R scripts can be executed within the R Console or outside of the R Console as batch operations.
We will examine some simple R Expressions and learn how to obtain help along the way.
The starting point for every R user is the R Console.
The R Console can be used to issue interactive R functions or expressions. The greater than (>) symbol is the default prompt for R.
When an R expression is complete, within the R... -
Lesson 1 – introduction to data analysis using r
In this lesson we will initially learn about the features and uses of R.
R is a software environment that is excellent for data analysis and graphics.
It was initially created in 1993 by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand. They created R as a language to help teach introductory statistics to their students. They based R on the S language that was developed earlier at Bell Labs in the... -
c:\>for %f in (*.sql) do sqlcmd /S <servername> /d <dbname> /E /i "%f" -
This is table valued function that will return a table.
'@' symbol indicates that whatever follows it is a variable.
The function accepts 3 variables viz @TXTFromDate which is a datetime datatype, @TXTToDate also a datetime datatype and @MFGPurpose a varchar type.
The query is performing a join on three tables viz. dps_chld1,pls_m ast,prd_mast and then the filtering clause is applied based on the function parameters and the result...Leave a comment:
-
Declare @t table(a int,b int,c int)
Code:Insert Into @t select 1,4,7 union all select 2,5,8 union all select 3,6,9 select d = a from @t union select b from @t union select c from @t
Leave a comment:
-
Though too late in answering but still ...Since you are writing in Asp.net .cs file, try with
Code:string tblName = "someTblName"; string str = string.Format("Select * From {0} ", tblName);
Leave a comment:
-
Try this
Code:Declare @str varchar(50) = '"vini katyal" <vinikatyal@yahoo.com>'
-------------
Code:Select Name = Left(@str, PATINDEX('%<%',@str)-1) ,Domain = Right(@str,Len(@str)-PATINDEX('%<%',@str)+1) ,Email = @str
Code:Select Name = Left(@str, CHARINDEX('<',@str)-1) ,Domain = Right(@str,Len(@str)-CHARINDEX('<',@str)+1)
Leave a comment:
-
Try this
Code:Declare @table1 table(T1Col1 int,T1Col2 int,T1Col3 varchar(50)) Insert Into @table1 Select 175, 056,'venkatesh' Declare @table2 table(T2Col1 int,T2Col2 varchar(50),T2Col3 varchar(50)) Insert Into @table2 Select 056,'venkatesh','NV' Select t1.* ,t2.* From @table1 t1 Join @table2 t2 On t1.T1Col2 = t2.T2Col1
------...Leave a comment:
-
Have a look at String Aggregation Techniques in Oracle. This will give you more ways of doing soLeave a comment:
-
-
I want my TransactionID to be in the format of <mmddyy99999999 > or 'TransactionDat e + ID'.
Solution
Code:Select Cast(ID as Varchar(10)) + REPLACE(CONVERT (VARCHAR(10), TransactionDate, 101), '/', '') As TransactionID
But the problem is that I need to reset my seed every 12AM so that my TransactionID the next day will be 0709110 then 0709111
Code:Run a job scheduler or a background
Leave a comment:
-
I have created a table as under
Code:Field DataType ------ -------- RowID (AutoIncrement) ID Number Open Number Close Number
Code:Insert into Table1(ID,Open) Select Table1.[ID], Table1.[Close] FROM Table1 where Table1.[RowID] = ( Select Count(*) from Table1);
Leave a comment:
-
Hi, I am a bit confuse about the data presented
..whether the input table contains one column (where the values are comma separated) or it has two columns. However, I am presenting the solution for both the cases
Case 1: Assuming the input table has two columns
e.g.
Code:Name Result John 90.00 John 95.00 John 98.00 Abraham 86.56 Abraham 23.67
Code:Declare
Leave a comment:
-
Leave a comment:
-
How about this
Code:' set rst=conn.execute (" select Watchedprofileid , p.pdjobtitle ,M.WatchinguserID from tblWatches M INNER join tblother P ON M.WatchinguserID = P.UserId where M.WatchinguserID > 5 And M.WatchinguserID = " & rs("userID") )
Leave a comment:
No activity results to display
Show More
Leave a comment: