> 15.3 * 5
[1] 76.5
>
The >sign is the prompt sign. It means that the R console is ready to accept
commands
The [1] tells us that this is the first element of the output (there is only one
element in this example).
___________________________________________________________________________________
______________________
> 15.3 * 5; 3*(4+5)
[1] 76.5
[1] 27
If one command is complete at the end of the line, R is ready to accept the next
command on
the next line.
___________________________________________________________________________________
______________________
Name Age
1 1 8
2 2 4
3 3 4
> head(k,1)
Name Age
1 1 8
2 2 4
3 3 4
> Str(k)
Error in Str(k) : could not find function "Str"
> str(k)
'data.frame': 3 obs. of 2 variables:
$ Name: int 1 2 3
$ Age : int 8 4 4
___________________________________________________________________________________
___________
summary(data)
Max,Min,..........
___________________________________________________________________________________
________
________________________________________________________________________
k[2,1] row 2 coulm 1
dat[,c(2,4)]# second and fourth column
k[,1]
[1] Karim Ahmed Ali
Levels: Ahmed Ali Karim
> table(k$Name,k$Age)
4 4.5 8
Ahmed 1 0 0
Ali 0 1 0
Karim 0 0 1
___________________________________________________________________________________
________
tapply(dat$P8, dat$sex, mean)
___________________________________________________________________________________
_____
an <- function() {
i<-1
for(i in 1:5)
{
if(i<=x){ if(Stage=="Dairy"){ print(y[i]*5)}
else if (Stage=="calf"){print(y[i]*5)}
}
}
}