Displaying 20 results from an estimated 9000 matches similar to: "Generation of labels for 2 factors"
2003 Nov 17
3
Accents in R
Hi,
How can I include accents and signs like '?' '?' in the plots generated by R?
I try, but R automatically transforms the name
ex:
> countries <- c("M?xico", "Espa?a")
> countries
[1] "M\216?xico" "Espa\216?a"
>
I've seen in some Spanish texts about R how is it normal to include labels of
the plots and other names with
2012 Oct 05
4
Procesar datos de mysql en R
Cordial Saludo.Deseo sacar los datos resultado de una encuesta en mysql procesarlos en r con el paquete de lógica difusa y proyectarlos en una pagina web dinámica.... de preferencia una solución multiplataforma... Linux. Windows. Necesito la mejor solución... Ya que encuentro muchos paquetes en r que podrían servir pero no estoy seguro... No se si un server web ejecute r eficientemente usando
2005 Aug 13
1
How to make a lagged variable in panel data?
Suppose we observe N individuals, for each of which we have a
time-series. How do we correctly create a lagged value of the
time-series variable?
As an example, suppose I create:
A <- data.frame(year=rep(c(1980:1984),3),
person= factor(sort(rep(1:3,5))),
wage=c(rnorm(15)))
> A
year person wage
1 1980 1 0.17923212
2 1981
2006 Jun 04
2
surprising dates
I wonder if this is an intentional feature or an oversight. in some
column summaries or in ifelse operations, apparently I am losing the
date property of my vector.
> a <- c(198012, 198101, 198102)
> b <- a*100+31
> c <- as.Date( as.character(b), "%Y%m%d" )
> summary(c)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2012 Nov 01
3
Duda gráfico DIN A-4
Hola,
¿Alguien me puede indicar cómo conseguir que un gráfico se adapte al formato DIN-A4, con su correspondiente verticalidad?. ¿Hay que hacerlo "manualmente" o existe algún parámetro/función que lo controle?.
Gracias.
Eva
[[alternative HTML version deleted]]
2005 Mar 12
1
Database reorganization
Hi people,
I need reorganization several databases. I would like to know if that is
possible in R. My problem is like that:
original data base:
Age x1980 x1981
1 5 8
3 7 9
5 9 15
7 11 20
future data base
year age x
1980 1 5
1980 3 7
1980 5 9
1980 7 11
1981 1 8
1981 3 9
1981 5
2008 Jun 06
2
write.table() error
Hi,
I got following error in write.table() :
> write.table(dataa, file="c:/data1.csv", row.names=F, col.names=T, sep=",")
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file 'c:/data1.csv': Permission denied
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),
2009 Mar 14
3
plotting question
Greetings all,
I have two questions. I have a data set that is arranged in the example
below. I wish to obtain a plot of the performance of each ID over Year
on v1. It's not clear how I set this up?
ID Year V1
1 1980 1
1 1981 2
1 1982 6
1 1983 4
2 1980 5
2 1981 5
2 1982 5
2 1983 6
Also,I would like to transpose the data to have the
2011 Nov 19
3
reshape data.frame
A late friday afternoon coding question. I'm having a hard time thinking
of the correct search terms for what I want to do.
If I have a df like this:
a <-
data.frame(name=c(rep('a',10),rep('b',15)),year=c(1971:1980,1971:1985),amount=1:25)
name year amount
1 a 1971 1
2 a 1972 2
3 a 1973 3
4 a 1974 4
5 a 1975 5
6 a 1976
1999 Jan 18
1
Program advice
Hi
Starting to use R as a serious tool, I have come across a programming
problem that I can't see the answer too yet. Can someone advise me plese.
The problem is that I want to plot a series of lines which represent short
term growths. All the data is in a single vector and I can indicate
the index via a second vector. In GLIM, if the second vector is a factor,
a single $GRA Size Year
2008 Apr 29
2
ggplot2: labels and breaks order does not match and I can't use scale_fill_identity
Hi,
I'm plotting a bar chart like this:
ggplot() +
geom_bar(data=res,aes(fill=f1,x=f2,y=y),stat="identity",position="dodge")
f1 contains quite a few levels and the plot is really quite difficult to
read when the order of bars on the graph and on the legend does not match.
This problem has been discussed recently here:
2008 Oct 07
1
column-wise z-scores by group
Hi,
I have a dataset of historical monthly temperature data that is grouped by
weather station. I want to create z-scores of the monthly data using a base
period of a subset of years. I subset the dataset first to include only data
from the years (V2) that make up the base period so I could calculate the
appropriate means and standard deviations
V1 V2 V3 V12 V15 V16 V19
84
2017 Sep 16
2
require help
You can just use the same code that I provided before but now use your
dataset. Like this
df <- read.csv(file="data2.csv",header=TRUE)
dates <- as.Date(paste(df$year,"-01-01",sep=""))
myXts <- xts(df,order.by=dates)
head(myXts)
#The last command "head(myXts)" shows you the first few rows of the xts
object
year cnsm incm wlth
2004 Mar 09
1
vector extraction
Hello,
I could need some help on this one:
>From the data.frame "Test.dataset2" below (TSCS data for 151
"countries.to.map" for "year" 1973-95; each "country.to.map" is described by
a unique code), I would like to extract a vector "color" that for each
"country.to.map" takes on the value of "dv" (a categorical variable with
2011 Feb 20
1
Conditional sum
Hi,
I have a DF like this:
DF = data.frame(read.table(textConnection(" A B C
1 b1 1999 0.25
2 c1 1999 0.25
3 d1 1999 0.25
4 a2 1999 0.25
5 c2 1999 0.25
6 d2 1999 0.25
7 a3 1999 0.25
8 b3 1999 0.25
9 d3 1999 0.25
10 a4 1999 0.25
11 b4 1999 0.25
12 c4 1999 0.25
13 b1 2001 0.5
14 a2 2001 0.5
15 b1 2004 0.33
16 c1 2004 0.33
17 a2 2004 0.33
18 c2 2004
2009 Nov 22
1
Metaplot Axis Annotation
Hello,
We are looking to adjust the font size of the axis annotation on the graph
that results from use of the metaplot() function. Metaplot seems to respond
to cex and cex.lab to change those graphical parameters, but it doesn't
respond to cex.axis. Is there a way to work around this by creating a
customized x-axis, and if so, how?
Thanks for all your help. Syntax is below.
Best,
Dawn
2012 Sep 08
1
Using predict() After Adding a Factor to a glm.nb() Model
# Hello,
# I have a data set that looks something like the following:
site<-c(rep('a',5),rep('b',2),rep('c',4),rep('d',11))
year<-c(1980, 1981, 1982, 1993, 1995, 1980, 1983, 1981, 1993, 1995,
1999, c(1980:1990))
count<-c(60,35,36,12,8,112,98,20,13,15,15,65,43,49,51,34,33,33,33,40,11,0)
data<-data.frame(site, year, count)
# > site year count
# 1
2017 Sep 16
0
require help
oky.. thank you very much to all of you
On Sat, Sep 16, 2017 at 2:06 PM, Eric Berger <ericjberger at gmail.com> wrote:
> You can just use the same code that I provided before but now use your
> dataset. Like this
>
> df <- read.csv(file="data2.csv",header=TRUE)
> dates <- as.Date(paste(df$year,"-01-01",sep=""))
> myXts <-
2017 Sep 22
2
require help
Assuming the input data.frame, DF, is of the form shown reproducibly
in the Note below, to convert the series to zoo or ts:
library(zoo)
# convert to zoo
z <- read.zoo(DF)
# convert to ts
as.ts(z) #
Note:
DF <- structure(list(year = c(1980, 1981, 1982, 1983, 1984), cnsm = c(174,
175, 175, 172, 173), incm = c(53.4, 53.7, 53.5, 53.2, 53.3),
with = c(60.3, 60.5, 60.2, 60.1, 60.7)),