labels

In Stata, how do I add variable labels from a separate csv file?

对着背影说爱祢 提交于 2019-12-22 12:19:22
问题 I have a set of csv files that are very simple to load into Stata using the -insheet- command. But they have very uninformative variable names. For each of these files, I also have a file of metadata consisting of two columns: the original (uninformative) variable names, and a description of what the variables actually mean. I'd like to use these metadata files to create variable labels, preferably without going through and typing up all the separate label commands or turning the metadata

Add Different Labels to Secondary X-Axis of Levelplot in Lattice in R

淺唱寂寞╮ 提交于 2019-12-22 09:47:41
问题 I've managed to label the secondary X-axis in a levelplot using scale=list((alternating=3)) as solved by @KoenV here: How to Add Labels to Top X-Axis of Levelplot in Lattice Package Now this duplicates the primary X-axis labels onto the secondary X-axis as can be seen by running the code below. However, I need to add different labels to the secondary X-axis. Does anyone know how to do this? In the example below I would like to have 'hor' as the primary X-axis labels and 'hor2' as the

Break nested loops

别说谁变了你拦得住时间么 提交于 2019-12-22 04:25:27
问题 Can someone tell me how to break the main loop when I have nested loops? Example*: /*Main loop*/ for(int y = 0; y < 100; y+=10) { /*Sub loop*/ for (int x = 0; x < 100; x += 10) { if(x == 60) { //Break the main loop } } } *This code do nothing, it's just an example What should I put in the place of the "Break main loop" comment? In java there are labels which I can break (when i set a label to the main loop named "MainLoop" I can write "break MainLoop;" and it will be valid), but what can I do

Color Labels (text) in R heatmap

一笑奈何 提交于 2019-12-21 18:43:31
问题 I am trying to make a heatmap in R in which the label text is colored (to indicate which group the data point comes from). I am currently using heatmap.2, but would be happy to use another package. heatmap.2(data.matrix(data),trace = 'none', dendrogram='none',ColSideColors=col) This call gives me the colored bar (ColSideColors) along the labels, but I'd like to make the labels themselves colored. Many thanks! 回答1: You will need to create a new function that includes the col.axis argument.

Color Labels (text) in R heatmap

♀尐吖头ヾ 提交于 2019-12-21 18:41:47
问题 I am trying to make a heatmap in R in which the label text is colored (to indicate which group the data point comes from). I am currently using heatmap.2, but would be happy to use another package. heatmap.2(data.matrix(data),trace = 'none', dendrogram='none',ColSideColors=col) This call gives me the colored bar (ColSideColors) along the labels, but I'd like to make the labels themselves colored. Many thanks! 回答1: You will need to create a new function that includes the col.axis argument.

Using Stata Variable Labels in R

旧时模样 提交于 2019-12-20 09:37:39
问题 I have a bunch of Stata .dta files that I would like to use in R. My problem is that the variable names are not helpful to me as they are like "q0100," "q0565," "q0500," and "q0202." However, they are labelled like "psu," "number of pregnant," "head of household," and "waypoint." I would like to be able to grab the labels ("psu," "waypoint," etc. . .) and use them as my variable/column names as those will be easier for me to work with. Is there a way to do this, either preferably in R, or

Matlab: avoid for loops to find the maximum among values with same labels

爷,独闯天下 提交于 2019-12-20 04:07:27
问题 I need to find the maximum among values with same labels, in matlab, and I am trying to avoid using for loops. Specifically, I have an array L of labels and an array V of values, same size. I need to produce an array S which contains, for each value of L , the maximum value of V . An example will explain better: L = [1,1,1,2,2,2,3,3,3,4,4,4,1,2,3,4] V = [5,4,3,2,1,2,3,4,5,6,7,8,9,8,7,6] Then, the values of the output array S will be: s(1) = 9 (the values V(i) such that L(i) == 1 are: 5,4,3,9

Using Core.Std.List.fold_left without label

你说的曾经没有我的故事 提交于 2019-12-20 02:37:05
问题 I am experimenting with Core's List.fold_left . # List.fold_left;; - : 'a Core.Std.List.t -> init:'b -> f:('b -> 'a -> 'b) -> 'b = <fun> It works fine when I specify the labels: # List.fold_left [1;2;3] ~init:0 ~f:(+);; - : int = 6 But I get a different result when I do not specify the labels: # List.fold_left [1;2;3] 0 (+);; - : init:(int -> (int -> int -> int) -> '_a) -> f:((int -> (int -> int -> int) -> '_a) -> int -> int -> (int -> int -> int) -> '_a) -> '_a = <fun> And other partial

Chart.js - Writing Labels Inside of Horizontal Bars?

淺唱寂寞╮ 提交于 2019-12-18 19:05:45
问题 In Chart.js, is there any way to write the labels inside of the horizontal bars in a "horizontalBar" chart? As in something like: Is anything similar to this possible in Chart.js? Thanks! 回答1: There is now on option "mirror" to make the label appear inside the bar. Example of "options" config for a horizontalBar chart : options: { scales: { yAxes: [{ticks: {mirror: true}}] } } Doc : http://www.chartjs.org/docs/latest/axes/cartesian/#common-configuration 回答2: With reference to the original

Chart.js - Writing Labels Inside of Horizontal Bars?

社会主义新天地 提交于 2019-12-18 19:05:18
问题 In Chart.js, is there any way to write the labels inside of the horizontal bars in a "horizontalBar" chart? As in something like: Is anything similar to this possible in Chart.js? Thanks! 回答1: There is now on option "mirror" to make the label appear inside the bar. Example of "options" config for a horizontalBar chart : options: { scales: { yAxes: [{ticks: {mirror: true}}] } } Doc : http://www.chartjs.org/docs/latest/axes/cartesian/#common-configuration 回答2: With reference to the original