similar to: Graphic with several curves

Displaying 20 results from an estimated 10000 matches similar to: "Graphic with several curves"

2008 Nov 15
3
I want my row name to be a variable
Hi R users Imagine this data.frame: >X Var1 Var2 A 22 13 B 5 2 C 12 8 D 1 99 A,B,C,D are the rows names (or index) Is there a way to create a new variable in this data frame which name is Var3 and which contains the rows names: Var1 Var2 Var3 A 22 13 A B 5 2 B C 12 8 C D 1 99
2012 Dec 01
5
How to built a pivot table of value
Hi R users Imagine the table "base": p=c("d","d","b","b","a","a") q=c("v1","v2","v1","v2","v1","v2") r=c(5,2,4,8,9,7) base=data.frame(p,q,r) base p q r 1 d v1 5 2 d v2 2 3 b v1 4 4 b v2 8 5 a v1 9 6 a v2 7 How programming R to
2005 Jun 15
4
Multiple line plots
Greetings, I would like to plot three lines on the same figure, and I am lost. There is an answer to a similar thread… but I tried matplot and it is beyond me. An example of the data follows: Year EM IM BM 1983 9.1 16.8 -7.7 1984 12.0 18.0 -6.0 1985 13.6 19.1 -5.5 1986 12.4 17.3 -4.9 1987 14.6 20.3 -5.7 1988 20.6 23.3 -2.6 1989 25.0 27.2 -2.2 1990 28.4 30.2 -1.8 1991 33.3 31.2 2.1 1992 40.6
2008 Nov 19
2
simplify this instruction
Hi R users, Is there a way to simplify this instruction: ifelse(B=="0","A", ifelse(B=="1","A", ifelse(B=="2","A", ifelse(B=="3","A", ifelse(B=="4","A", ifelse(B=="5","A", ifelse(B=="6","A", ifelse(B=="7","A",
2008 Nov 16
1
Are you sure a table can become a data.frame?
Hi R users, Imagine X as a data frame: X=read.table(textConnection(" Var1 Var2 1 A H 2 B K 3 A H 4 B H 5 C L "),header=TRUE) closeAllConnections() X X is a data frame Var1 Var2 1 A H 2 B K 3 A H 4 B H 5 C L Y<-table(X$Var1,X$Var2) Y is a cross table between Var1 and Var2
2001 Dec 05
3
one command on several lines
Hello! Is it possible to continue expand one command on several lines in R ? An attempt to write a=c(1990," ",1991, 1992, 1993,1994,1995,1996,1997,1998, 1999) in a file and then source('file') results in Error in parse(file, n, text, prompt) : syntax error on line 55 Thanks. Nick
2006 Nov 23
1
how to loop this?
Hi, I have the next procedure: t1<-data.frame(table(substr(names(subset(lasker[[1]], lasker[[1]] >= 4)), 1, 7))) t1[1:5,] Var1 Freq 1 1988-02 3 2 1988-03 1 3 1988-04 1 4 1988-05 2 5 1988-06 3 How to make a new list?, dataframe? having 189 elements in the 'lasker' list: > str(lasker[[1]]) 'table' int [, 1:1274] 1 1 3 2 1 5 4 1 1 4 ... -
2006 Nov 22
3
dataframe manipulation
Hi, Having a dataframe 'l1' (dput output is below): >dim(l1) 1274 2 >l1[1:12,] Var1 Freq 1 1988-01-13 1 2 1988-01-16 1 3 1988-01-20 3 4 1988-01-25 2 5 1988-01-30 1 6 1988-02-01 5 7 1988-02-08 4 8 1988-02-14 1 9 1988-02-16 1 10 1988-02-18 4 11 1988-02-24 2 12 1988-03-04 1 I want to extract the times
2012 Sep 21
2
efficient overlapping average curve on original curves
Dear useRs, my question could be very basic for which i apologize in advance. Each column of a matrix with dimensions 365 rows and 37 columns was drawn against another matrix of dimensions 365 rows and 1 column. with that i was able to draw 37 curves on the same axis. now i want to draw an average curve of these 37 curves on the same axis in such a way that all the curves (average and 37
2018 Dec 04
3
concurrent migration of several domains rarely fails
Hi, i have a two-node cluster with several domains as resources. During testing i tried several times to migrate some domains concurrently. Usually it suceeded, but rarely it failed. I found one clue in the log: Dec 03 16:03:02 ha-idg-1 libvirtd[3252]: 2018-12-03 15:03:02.758+0000: 3252: error : virKeepAliveTimerInternal:143 : internal error: connection closed due to keepalive timeout The
2006 Nov 26
1
adding elemens to a list
Hi, I have a list of 20 elements, each of them of variable length and with a structure like this: lasker[[1]][1:10,] Var1 Freq 1 1988-02 3 2 1988-03 1 3 1988-04 1 4 1988-05 2 5 1988-06 3 6 1988-07 1 7 1988-08 1 8 1988-09 1 9 1989-03 1 10 1989-04 1 How do I can insert in this list: 1988-01 0 1988-10 0 1988-11 0 1988-12 0 1989-01 0
2017 Jun 07
0
Determining which.max() within groups
cumsum() seems to be what you need. This can probably be done more elegantly, but ... out <- aggregate(Q ~ wyr, data = Daily, which.max) tbl <- table(Daily$wyr) out$Q <- out$Q + cumsum(c(0,tbl[-length(tbl)])) out ## yields wyr Q 1 1990 4 2 1991 6 3 1992 9 4 1993 15 5 1994 18 I leave the matter of Julian dates to you or others. Cheers, Bert Bert Gunter "The trouble
2017 Jun 07
4
Determining which.max() within groups
Using the dataset below, I got close to what I'm after, but not quite all the way there. Any suggestions appreciated: Daily <- read.table(textConnection(" Date wyr Q 1911-04-01 1990 4.530695 1911-04-02 1990 4.700596 1911-04-03 1990 4.898814 1911-04-04 1990 5.097032 1911-04-05 1991 5.295250 1911-04-06 1991 6.569508 1911-04-07 1991 5.861587 1911-04-08 1991 5.153666
2010 Apr 08
1
reshape panel data
I have a data set with observations on 549 cities spanning an 18 year period. However, some of cities did not report in one or more of the 18 years. I would like to implement the procedure suggested by Wooldridge section 17.1.3 in his "Econometric analysis of cross section and panel data" to correct for attrition. For example the table below indicates that the 3rd and the 7th cities in
2012 Aug 02
4
Subseting
Hi everyone I have banking data set in long format with 4 columns.One of these columns is bank name which consist of 49 banks and I want the data for only 40 banks out of these 49 so can anyone help me on how to get this 40 banks data My data looks like Year Name totalliabilties assets 1990 a 90 10 1991 a 89 48 1992 a 87
2011 Feb 01
4
How to Plot Two Curves Into One Page
I have a R script that contain these lines for plotting: plot(foo,lwd=2,lty=3,col="red", main=""); plot(bar,lwd=2,lty=3,col="blue"); legend(0.6,0.6,c('Default','Probabilistic'), col=c('red','blue'),lwd=3); But it generate 1 file (Rplot.pdf) with two pages. Each page for 1 plot. Is there a way I can put them together in to one page?
2013 Mar 14
1
ggplot2 problem
Hello all! I have a problem with ggplot2 library. I want to do an heat map and the y variables are the year months. If I use the following code, he y values are in alphabetical order, but I want it in month order. The code is: library(reshape) library(ggplot2) library(scales) p <- ggplot(data.m, aes(variable, Month)) + geom_tile(aes(fill = value),
2012 May 08
1
grouping function
Hello, I would like to write a function that makes a grouping variable for some panel data . The grouping variable is made conditional on the begin year and the end year. Here is the code I have written so far. name <- c(rep('Frank',5), rep('Tony',5), rep('Edward',5)); begin <- c(seq(1990,1994), seq(1991,1995), seq(1992,1996)); end <- c(seq(1995,1999),
2010 Mar 01
1
Generating variable from 2 others in dataframe
Suppose I have the following dataframe called test: test<-data.frame(year=rep(1990:2003,5),id=gl(5,length(1990:2003)),eif=as.vector(sapply(1:5,function(z){a<-rep(0,length(1990:2003));a[sample(1:length(1990:2003),sample(1:2,1))]<-1;a}))) year id eif 1990 1 0 1991 1 0 1992 1 0 2000 1 1 1994 1 0 1995 1 0 2001 1 0 1997 1 1 .... I want to create a new variable in
2005 Nov 17
1
Help with read.csv2
Hello, I am importing the following file ;aa;bb;cc 1988;12;12;12 1989;78;78;12 1990;78;78;12 1991;78;78;12 1992;78;78;12 1993;78;78;12 1994;78;78;12 ------------------------------------------------ data<-read.csv2("test.csv",header=T) ------------------------------------------ it gives X aa bb cc 1 1988 12 12 12 2 1989 78 78 12 3 1990 78 78 12 4 1991 78 78 12 5 1992 78 78 12 6