發表文章

目前顯示的是 12月 5, 2018的文章

ggplot reports a continuous variable is categorical; what am I missing?

圖片
up vote 0 down vote favorite I'm trying to loop through a dataframe and based on whether the column is a factor or a number return a faceted ggplot. library(tidyverse) d <- mtcars # make a couple factors d2 <- d %>% mutate_at((vars(matches("cyl"),matches("gear"))), as.factor) #check (d2 %>% map_lgl(is.factor)) (d2 %>% map_lgl(is.numeric)) This works: plot_chart <- function(df, na.rm = TRUE){ nm = names(df) for (i in nm) { nm_p <- grep(paste("^",i,"$",sep=""), nm) #finds the position of i in the sequence g <- ggplot(df, aes_string(x = i)) print(nm_p) # progress to console if (is.factor(df[,nm_p])==TRUE) { g <- g + geom_bar() } else if (is.numeric(df[,nm_p])) { g <- g + geom_histogram(bin

精米機

圖片
循環式精米機 家庭用撹拌式精米機 左)精米前 右)胚芽米精米後 精米機 (せいまいき)とは、玄米または籾から糠(ぬか)を取り除いて白米にする(つまり精米)ために用いる農業機械である。現在は小型の家庭用も利用されている。 目次 1 概要 2 種類 2.1 構造上の区分 2.1.1 摩擦式精米機 2.1.2 研削式精米機 2.2 利用形態による区分 3 脚注 4 外部リンク 概要 糠を取り除いて白米にする作業工程は「精白」と呼ばれる。一般の食料用(飯米用)に生産された玄米を精白する主な目的は、米の消化吸収を助け、食味を良くするためである。玄米の外周部分約7%から10%を削り落とすので、実際の白米は精米歩合が90%から93%程度となる。 一方、酒造用に使用する米も精白されるが、その目的は食料用の場合と異なり、口当りが良くて雑味のより少ない酒を醸造するためである。精米歩合はさらに高くなる。 英語では "Rice polishing machine"、"Rice polisher、Rice whitening machine"、"Rice whitener" などと呼ばれる。 なお、精米機や精麦機など穀類一般を精製するための機械を「精穀機」という [1] 。 種類 コイン精米機(右の玄米投入口に玄米を入れ、硬貨を入れて好みの白さのボタンを押すと精米が始まり、左からコメが出てそれを袋に落とす。おおむね玄米からは10kg100円、籾米からは6kg100円。) 構造上の区分 その構造から見た場合、次の種類がある。 摩擦式精米機 これは、主に玄米相互間に作用する摩擦力によって玄米の糠を除去する方式である。 循環式精米機 上部に備え付けられたロート状のタンクに玄米を入れ、タンク下部にあるローラー(回転刃)が糠を除去する。タンクの下部では玄米に掛かった圧力を利用して糠を削ぎ落とす。研磨の工程で一定の圧力を掛ける必要があるため、一度の作業で1斗(15キロ)ないし2斗の玄米を投入するようになっており、少量の玄米を精白する用途には向かない。適正な圧力が掛

Type 'Post[]' is not assignable to type 'Observable': error TS2322

圖片
up vote 0 down vote favorite I have googled both the message and error and it seems the issue I keep finding is not what I am dealing with. I am an angular noob and feel I am finally close to getting my service wired up. I am getting the above error on my component it will squawk at the this.posts below. getPosts() { this.postsService.get() .subscribe((data: Post) => this.posts = data);}; and my service in case theres an issue there. public get(): Observable<Post> { return this.http .get<Post>(this.accessPointUrl);} Someone save my morning please! angular typescript share | improve this question asked Nov 8 at 11:50