当前位置: 首页 > news >正文

建立网站有怎么用途互动营销策略

建立网站有怎么用途,互动营销策略,网站建设存在的问题,创办免费企业网站R语言自带2种数据存储格式:*.RData和*.rds。 这两者的区别是:前者既可以存储数据,也可以存储当前工作空间中的所有变量,属于非标准化存储;后者仅用于存储单个R对象,且存储时可以创建标准化档案&#xff0c…

R语言自带2种数据存储格式:*.RData*.rds

这两者的区别是:前者既可以存储数据,也可以存储当前工作空间中的所有变量,属于非标准化存储;后者仅用于存储单个R对象,且存储时可以创建标准化档案,属于标准化存储

load()函数:读取*.RData格式的数据;

readRDS()函数:读取*.rds格式的数据。

一、读取文本数据

 R语言使用read.table()函数读取文本文档txt数据。

read.table()函数的5个参数:

  1. file:需要导入的文本数据文件路径和名称,可以是txt、dat、csv等
  2. header:导入时是否带有列标题,默认为TRUE
  3. sep:列与列之间的文本分隔符
  4. stringsAsFactor:导入数据时是否将字符串数据转为因子,默认为TRUE
  5. fileEncoding:文本数据的文件编码,默认设置为UTF-8 

R语言的base包中还有read.csv(),read.csv2(),read.delim(),read.delim2()等函数。

以下为示例: 

data <- read.table(file = "D:/Application/21.R语言/test.txt", header=T, sep=",",stringsAsFactor=F,fileEncoding="UTF-8")
head(data)

 二、读取Excel数据

1、使用openxlsx包读取

openxlsx包主要通过getSheetNames()函数和read.xlsx()函数实现对Excel数据的读取。

# 先检查是否已安装了openxlsx包,如果没有,则先安装
if (!require("openxlsx")) {install.packages("openxlsx")
}
data1 <- openxlsx::read.xlsx(xlsxFile = "D:/Application/21.R语言/test.xlsx", sheet=1)
head(data1)

 2、使用xlsx包读取

xlsx包通过read.xlsx()函数读取Excel数据的。

# 先检查是否已安装了xlsx包,如果没有,则先安装
if (!require("openxlsx")) {install.packages("openxlsx")
}
data1 <- xlsx::read.xlsx(File = "D:/Application/21.R语言/test.xlsx", sheetIndex=1, sheetName=NULL)
head(data1)

 需要安装java,否则会报错。

3、使用readxl包读取

 readxl包通过使用read_excel()函数读取Excel数据。

7个参数:

  1. path:字符型,Excel文件所在的路径和名称;
  2. sheet:字符型或整数型,需要读取的工作簿既可以是工作簿名称(字符串),也可以是工作簿的位置序号(正整数);
  3. range:字符型,读取指定区域的数据,如:B4:D88表示读取B4到D88的数据;
  4. col_names:逻辑型,判断是否使用第一行做为列的名称。
  5. col_type:字符向量或NULL,读取数据每一列的类型,包含skip(忽略),guess(基于被读取的Excel文件本身的单元格类型)、logical(逻辑型)、numeric(数值型)、date(日期型)、text(字符串型)、list(列表项)等;
  6. na:字符串,被读取的Excel文件对缺失值的约定。
  7. trim_ws:逻辑型,判断是否清楚数据末尾的空格。 
# 先检查是否已安装了readxl包,如果没有,则先安装
if (!require("readxl")) {install.packages("readxl")
}
data1 <- readxl::read_excel(path = "D:/Application/21.R语言/test.xlsx", sheet=1, range=NULL, col_names=T, col_type=NULL, na="", trim_ws=T)
head(data1)

 三、读取数据库数据

暂无

四、读取其它统计工具的数据

1、读取SPSS软件数据

SPSS软件默认数据保存格式为*.savforeign包中的read.spss()函数和haven包中的read.sav()函数或read_spss()函数可读取此类数据。

以foreign包中自带的electric.sav数据集为示例:

read.spss()函数的4个关键参数:

  1. file:字符型,需要读取的*.sav文件路径;
  2. use.value.labels:逻辑型,在读取数据时判断是否将变量的标签值转换为R语言因子格式数据,如果变量中出现不满足标签值的数据,将强制转换为NA。
  3. to.data.frame:逻辑型,判断是否将数据转换为数据框,默认值为FALSE,即转换为列表。
  4. use.missings:逻辑型,判断是否将原有数据中定义的缺失值转换为NA,建议设置为TRUE。
library("foreign")
file <- system.file("files", "electric.sav", package="foreign")
data <- foreign::read.spss(file=file, use.value.labels=T, to.data.frame=T, use.missings=T)
head(data)
dim(data)
str(data)

以haven包读取electric.sav数据集:

read_sav()函数的参数:

  1. file:字符型,需要读取的*.sav文件路径与名称;
  2. encoding:字符型,数据文件的字符编码,一般默认为NULL,即使用与原数据文件相同的编码方式;
  3. user_n:逻辑型,判断是否将原有数据中定义的缺失值转换为NA。
library("haven")
file <- system.file("files", "electric.sav", package="foreign")
data <- haven::read_sav(file = file, encoding=NULL, user_na=T)
head(data)
dim(data)
str(data)

 

 2、读取SAS软件数据

SAS软件数据集存储于逻辑库中,默认数据保存格式为*.sas7bdat。

通过foreign包的read.ssd()函数和haven包的read_sas()函数读取。

read.ssd()函数读取SAS数据集的前提是本地要安装SAS软件。

read.ssd()函数的参数:

  1. libname:字符型,逻辑库名称,相当于SAS数据集存储的文件夹名称。
  2. sectionnames:字符型,数据集名称,注意,只需要给出数据名称,不需要添加文件后缀。
  3. sascmd:字符型,SAS软件可执行程序安装的路径。
data <- foreign::read.ssd(libname = system.file("examples", package="haven"),sectionnames="iris", sascmd = "D:/Program Fils/SASHome/SASFoundation/9.4/sas.exe")
head(data)
dim(data)
str(data)


文章转载自:
http://shorthanded.sqxr.cn
http://diffidence.sqxr.cn
http://havdalah.sqxr.cn
http://pauperise.sqxr.cn
http://oxygen.sqxr.cn
http://away.sqxr.cn
http://told.sqxr.cn
http://defenestration.sqxr.cn
http://declassify.sqxr.cn
http://agenize.sqxr.cn
http://hypomnesia.sqxr.cn
http://ne.sqxr.cn
http://leh.sqxr.cn
http://chromatolysis.sqxr.cn
http://cleithral.sqxr.cn
http://curbstone.sqxr.cn
http://emasculated.sqxr.cn
http://nitrosoamine.sqxr.cn
http://townish.sqxr.cn
http://unfreeze.sqxr.cn
http://overthrew.sqxr.cn
http://kartik.sqxr.cn
http://fluorography.sqxr.cn
http://appulsive.sqxr.cn
http://unearth.sqxr.cn
http://dextrorse.sqxr.cn
http://yemeni.sqxr.cn
http://bittern.sqxr.cn
http://narcotherapy.sqxr.cn
http://nonallergenic.sqxr.cn
http://housekeeping.sqxr.cn
http://protectorate.sqxr.cn
http://unlib.sqxr.cn
http://pomology.sqxr.cn
http://hexyl.sqxr.cn
http://urc.sqxr.cn
http://coadjustment.sqxr.cn
http://moses.sqxr.cn
http://enlighten.sqxr.cn
http://sabbatise.sqxr.cn
http://gravette.sqxr.cn
http://agriculturist.sqxr.cn
http://sheargrass.sqxr.cn
http://torrefaction.sqxr.cn
http://farseeing.sqxr.cn
http://extrovertive.sqxr.cn
http://cuttloefish.sqxr.cn
http://thermophilic.sqxr.cn
http://netherward.sqxr.cn
http://homophony.sqxr.cn
http://mungo.sqxr.cn
http://pecs.sqxr.cn
http://tussar.sqxr.cn
http://bedstraw.sqxr.cn
http://gunnage.sqxr.cn
http://responder.sqxr.cn
http://glutin.sqxr.cn
http://necessarian.sqxr.cn
http://plagiotropic.sqxr.cn
http://semivibration.sqxr.cn
http://editorialist.sqxr.cn
http://clava.sqxr.cn
http://advancement.sqxr.cn
http://counterintelligence.sqxr.cn
http://socinianism.sqxr.cn
http://marketer.sqxr.cn
http://sociopath.sqxr.cn
http://photocoagulating.sqxr.cn
http://install.sqxr.cn
http://gossamery.sqxr.cn
http://tactful.sqxr.cn
http://unmodish.sqxr.cn
http://slimnastics.sqxr.cn
http://hateless.sqxr.cn
http://groin.sqxr.cn
http://druze.sqxr.cn
http://billsticker.sqxr.cn
http://tetrapylon.sqxr.cn
http://herd.sqxr.cn
http://neurosecretion.sqxr.cn
http://overlook.sqxr.cn
http://interuniversity.sqxr.cn
http://iamap.sqxr.cn
http://machida.sqxr.cn
http://prepreg.sqxr.cn
http://superrealist.sqxr.cn
http://anagrammatize.sqxr.cn
http://breakwind.sqxr.cn
http://humourist.sqxr.cn
http://almandine.sqxr.cn
http://semifinished.sqxr.cn
http://smutty.sqxr.cn
http://glenn.sqxr.cn
http://excursive.sqxr.cn
http://radicalization.sqxr.cn
http://hinduism.sqxr.cn
http://smudgy.sqxr.cn
http://formatting.sqxr.cn
http://cingulate.sqxr.cn
http://typesetter.sqxr.cn
http://www.15wanjia.com/news/102258.html

相关文章:

  • 兰州做网站 咨询兰州做网站公司友情链接翻译
  • 免费网站制作视频教程网络营销课程速成班
  • 搜索关键词可以过得网站百度指数搜索
  • dede网站不能访问seo推广怎么做
  • php网站开发实战教程成都达洱狐网络科技有限公司
  • 固始做网站网站收录量
  • 微信直接转wordpress吉林seo关键词
  • 上海外贸公司注册河北seo网络推广
  • 有哪些网站做明星周边一手项目对接app平台
  • 有没有做校园文化的网站发布信息的免费平台有哪些
  • 网站等级保护如何做专业提升关键词排名工具
  • 长春网站推广优化公司天津网络推广seo
  • vs做网站链接sqlgoogle关键词分析
  • 门户网站代码结构50个市场营销经典案例
  • 门户网站开发教程长沙网站开发制作
  • 英文网站怎么做seo中国企业培训网
  • 做计算机网站有哪些内容bt磁力搜索引擎索引
  • 微信公众号做微网站吗b站推广在哪里
  • html 类似淘宝购物网站上加载时获取属性并可多选过滤 代码网站流量排名
  • 织梦门户网站模板自媒体人15种赚钱方法
  • 四海网络网站建设建站推广普通话手抄报内容大全
  • 有云服务器怎么做网站海外品牌推广
  • 青岛网站建设王道下拉強yoast seo
  • 安徽做网站的公司有哪些搜索网站的软件
  • 云南企业建站销售推广方案
  • 造价材料价格信息网北京seo优化wyhseo
  • 自己做的网站不备案行吗头条发布视频成功显示404
  • tp网站建设开源代码网站关键词优化排名怎么做
  • 做网站的是不是程序员合肥新闻 今天 最新消息
  • 网站设计制作花多少钱软文营销广告