Академический Документы
Профессиональный Документы
Культура Документы
WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work.
Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system
preferences accordingly.
[History restored from /Users/ReynaldoFarera/.Rapp.history]
> c(2,3,5,8,13)
[1] 2 3 5 8 13
> Country = c("Brazil","China","India","Switzerland","USA")
> LifeExpectancy = c(74,76,65,83,79)
> Country
[1] "Brazil" "China" "India" "Switzerland" "USA"
> LifeExpectancy
[1] 74 76 65 83 79
> Country[1]
[1] "Brazil"
> LifeExpectancy[3]
[1] 65
> seq(0,100,2)
[1] 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34
[19] 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70
[37] 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
> CountryData = data.frame(Country,LifeExpectancy)
> CountryData
Country LifeExpectancy
1 Brazil 74
2 China 76
3 India 65
4 Switzerland 83
5 USA 79
> CountryData$Population = c(199000,1390000,1240000,7997,318000)
> CountryData
Country LifeExpectancy Population
1 Brazil 74 199000
2 China 76 1390000
3 India 65 1240000
4 Switzerland 83 7997
5 USA 79 318000
> Country = c("Australia","Greece")
> LifeExpectancy = c(82,81)
> Population =c(23050,11125)
> NewCountryData = data.frame(Country,LifeExpectancy,Population)
> NewCountryData
Country LifeExpectancy Population
1 Australia 82 23050
2 Greece 81 11125
> AllCountryData = rbind(CountryData,NewCountryData)
> AllCountryData
Country LifeExpectancy Population
1 Brazil 74 199000
2 China 76 1390000
3 India 65 1240000
4 Switzerland 83 7997
5 USA 79 318000
6 Australia 82 23050
7 Greece 81 11125
>