跳过正文
  1. Posts/

Learning R in Kaggle

··1 分钟
Dr. Hui Lin (林辉)
作者
Dr. Hui Lin (林辉)
极地海洋化学研究者 | 溶解有机质 (DOM) | 南北极科考

I’m learning data analysis and explore in R following the tutorial posted in Kaggle

Here are some sentences I found it useful.

train <- read.csv('../input/train.csv', stringsAsFactors = F)

This is how to read csv files. Also, use read.delim(), read.delim2() to read txt file.read documentation

stringAsFactors is a useful factor. Here we do not want to use the headers as factors.

str(dataframe) use this to check data. Also if you use R Studio, use view(dataframe) to check data.

To check dataframe, we can also use tbl_df function.

full_df <- tbl_df(full)
full_df

相关文章

Learning R using Swirl

··1 分钟
用Swirl学习R语言,Learn R, in R # how to import data (read function) how to manipulate data wit dplyr lesson: Getting and Cleaning Data # 我们可以使用read.csv函数来导入数据。具体查看?read.csv,例子 #set a path to csv file path2csv <-"E:/R-3.3.2/library/swirl/Courses/Getting_and_Cleaning_Data/Manipulating_Data_with_dplyr/2014-07-08.csv" #use read.csv to read the csv file mydf<-read.csv(path2csv,stringsAsFactors = FALSE) #stringsAsFactors: logical: should character vectors be converted to factors? 使用dim()查看数据的行列情况

R basics

··3 分钟
R语言学习笔记 # 这里是关于一些R语言的语法备忘 Learning Website Unit 1 Assignment and basic calculation # myapples = 3 or myapples <- 3 +, -, *, /, ^ %% means the remainder. Unit 2 Vectors # combine function: c()