被启迪-R画出我的心
来源:互联网 发布:单项软件开发资质 编辑:程序博客网 时间:2024/04/30 02:13
先来个正经的图
code
#导包library(animation)#注释一下,生成gif会使用到ImageMagick软件自己上网上找。#如果出现convert: 455: unable to load module`C:\ImageMagick\modules\coders\IM_MOD_RL_PNG_.dll‘#请下载Microsoft Visual C++ 2008 Redistributable Package,还有就是环境变量的锅了。#♥新型t<-seq(0,2*pi,by=0.1)x<-16*sin(t)^3y<-13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)a<-(x-min(x))/(max(x)-min(x))b<-(y-min(y))/(max(y)-min(y))#gif生成saveGIF({ for (i in seq(1,length(a),3)){ sch<-a[1:i] u<-b[1:i] plot(sch,u) } text(0.2,0.6,"i love u") text(0.8,0.1,"by sch")}, movie.name = "bsh.gif")
来个不正经的图
#codea1<-seq(0,2,0.01)b1<-seq(0,1,0.01)f<-function(a1,b1) ifelse(a1<=1, 11*a1*log10(a1)*b1*(b1-1)+exp(-((25*a1-25/exp(1))^2+(25*b1-25/2)^2)^3)/25, 11*(a1-1)*log10(a1-1)*b1*(b1-1)+exp(-((25*(a1-1)-25/exp(1))^2+(25*b1-25/2)^2)^3)/25) c1<-outer(a1,b1,f)persp(a1,b1,c1,theta=30,phi=30,expand=0.5,col="blue")
一部分去年的文本代码,就在这里保存一下。
library(plyr)library(stringr)library(jiebaR)library(tm)transword="感冒"filenames=dir()filenames00<- grep('\\.txt', filenames, value = TRUE)txtinuse<-c()j=1for(filename in filenames00) { path=paste0(getwd(),'/',filename) txtinuse[j]=readChar(path,file.info(path)$size) j=j+1}v=txtinusev00=as.character(v)v01=v00v00=gsub("\n","",v00)v00=gsub("\\x","",v00)#v00=gsub("x","",v00)v00=strsplit(v00,"。")#typeof(v00)#v00[2]v00<-as.vector(unlist(v00))#str(v00)#typeof(v00)x=grep(transword,v00)#xv00=v00[x]#head(v00)removewords <- function(target_words,stop_words){ target_words = target_words[target_words%in%stop_words==FALSE] return(target_words)}engine <- worker()stopwords <- readLines("../mystopword.txt", encoding ='gbk')words <- removewords(segment(v00, engine), stopwords)wf <- as.data.frame(table(words))wf <- wf[order(wf$Freq, decreasing = TRUE), ]text_corpus <- Corpus(x = VectorSource(v00))text_corpus <- tm_map(text_corpus, removeNumbers)text_corpus<-tm_map(text_corpus, removePunctuation)text_corpus<-tm_map(text_corpus, stripWhitespace)#inspect(text_corpus)#构建语料库
阅读全文
0 0
- 被启迪-R画出我的心
- 一篇文章对我的启迪
- 利用R语言画出词云的一些实验
- R快速画出可以交互的热图[d3heatmap|heatmaply]
- “X”的启迪
- 时钟的启迪
- 苍蝇逃生的启迪
- 启迪
- 多看看的启迪故事
- 给你人生的启迪飞鸽传书
- 用 matlab 画出心的图像
- 如何在R中画出高效美观的相关性分析图
- 如何利用R语言画出三维动画图
- 利用R语言画出两地路线图
- 我学习的R函数
- 我的R学习笔记
- 启迪故事[转自键者天行的blog]
- 启迪故事之 -- 井底的驴
- Laplacian Matrix
- wstring转string
- 答答租车系统java代码实现
- Android studio Xposed框架Hook小试
- 7-21 字符串循环左移(20 分)
- 被启迪-R画出我的心
- Python 魔法方法详解
- 计算机视觉整理库
- 解决thymeleaf模板的html标签不提示
- NDK各个版本链接
- MySQL基础-1-row_number() over( partition by expr1,expr2... order by expr1)
- caffe反卷积层
- HTML右下角弹窗
- [日推荐]『忆年共享空间』小而美的私密相册空间