Displaying 20 results from an estimated 300 matches similar to: "Como modificar valores en un data frame"
2015 Sep 22
4
Excel vs. R
Hola, escribo porque tengo una gran duda como gráficas tan fáciles en Excel
son tan difíciles en R?
No consigo hacer una gráfica en R de estas características. Osea como puedo
dividir por sitios por tamaños. En una planilla enorme tengo la primera
columna son las estaciones (pero solo quiero las tres ultimas) y después
muchos parámetros, en las columnas 46, 53 y 60 los promedios ponderados. Y
no
2015 Sep 22
2
Excel vs. R
Antes que nada puedes encontrar documentación sobre la librería ggplot2 que
es la que yo uso para gráficos como el que quieres hacer, aunque hay otros
paquetes que te pueden ser útiles:
http://docs.ggplot2.org/current/
Adicionalmente a lo dicho por Carlos aquí te van otros ejemplos (los agrego
porque no nos proporcionaste datos con lo que pudiéramos ver mejor lo que
buscas):
2015 Jul 28
2
función cantidad mayor de valores
Hola Javier,
Intenta los siguientes cambios
g4 <- function(codigo_llega, n_caracteres){
codigo_llega <- as.character(codigo_llega)
if(n_caracteres == 6) res <- substr(codigo_llega, start=0, stop=4)
else res <- codigo_llega
res
}
g4 <- Vectorize(g4)
x <- c('Jorge Velez','Javier Marcuzzi','Daniel Merino','Susana deus
Alvarez', 'Carlos
2006 May 24
2
data.frame
Dear all,
Does any one knows why should I get the following error message, when trying
to do a simple data.frame??
DataF<-data.frame(Subject,BiomR,Spp,Capas,Litter,Herbs,LitterD,MaxCanH,DDifS
p,DSSp,Slope, CanDens,NearestSp)
Erro em data.frame(Subject, BiomR, Spp, Capas, Litter, Herbs, LitterD, :
arguments imply differing number of rows: 202, 0
The data I am using
2007 Feb 09
2
heatmap color specification
hi,
I have a positive integer matrix like:
test<-matrix(c(1,2,2,2,2,1,1,2,3),3)
and based on the distant function I made like this:
generateDistMat<-function (target)
{
n <- nrow(target)
rn <- rownames(target)
distM <- matrix(NA, n, n)
diag(distM) <- 0
for (i in 1:(n - 1)) for (j in (i + 1):n) {
distM[i, j] <- length(which(target[i, ] !=
2013 Jan 27
3
Package: VennDiagram. Error in draw.pairwise.venn Impossible: cross section area too large
Dear list,
When I use VennDiagram package, I got a error as follow:
venn.plot <- draw.pairwise.venn(
area1 = 3186,
area2 = 325,
cross.area = 5880);
Error in draw.pairwise.venn(area1 = 3186, area2 = 325, cross.area = 588) :
Impossible: cross section area too large.
Does anyone have suggestion?
Thank you.
2011 Mar 20
2
R as a non-functional language
I'm reading Torgo (2010) *Data Mining with
R*<http://www.liaad.up.pt/~ltorgo/DataMiningWithR/code.html>in
preparation for a class I'll be teaching next quarter. Here's an
example
that is very non-functional.
> pH <- c(4.5,7,7.3,8.2,6.3)
> names(pH) <- c('area1','area2','mud','dam','middle')
> pH
area1 area2 mud dam
2010 Nov 18
3
problems subsetting
Dear all,
I have searched the forums for an answer - and there is plenty of
questions along the same line - but none of the paproaches shown worked
to my problem:
I have a data frame that I get from a csv:
summarystats<-as.data.frame(read.csv(file=f_summary));
where I have the columns Dataset, Class, Type, Category,..
Problem1: I want to find a subset of this frame, based on values in
2011 Jan 19
3
question about result of loglinear analysis
Hi all:
Here's a question about result of loglinear analysis.
There're 2 factors:area and nation.The raw data is in the attachment.
I fit the saturated model of loglinear with the command:
glm_sat<-glm(fre~area*nation, family=poisson, data=data_Analysis)
After that,I extract the coefficients:
result_sat<-summary(glm_sat)
result_coe<-result_sat$coefficients
I find that all the
2003 May 21
1
help on spatial data
Hi,
I have a dataset with x and y coordinates and in each point I have an
identity of point, in some cases I can have more then one identity by point.
My dataset is something like this:
> x <- rep(c(1:4),4)
> y <- rep(c(1:4),c(4,4,4,4))
> area1 <- sample(factor(rep(c("a","b","c","d"),4)))
> area2 <-
2010 Nov 23
2
Help with grouped barplot
Given the data structure below, how can I create a bar plot for the values of disc for each area grouped by year?
bar <-structure(list(year = c(2003, 2003, 2003, 2003, 2003, 2003, 2003,
2007, 2007, 2007, 2007, 2007, 2007, 2007), area = structure(c(6L,
4L, 1L, 2L, 3L, 5L, 7L, 6L, 4L, 1L, 2L, 3L, 5L, 7L), .Label = c("AK",
"ID", "MT", "NW",
2002 Jan 09
2
How to obtain the series of residuals from fracdiff
Hi
I'm using fracdiff package to estimate the parameters of a
fractionally-differenced ARIMA (p,d,q) model, and it works fine, but I wanted
to have also the filtered series and the series of residuals.
I understand these are calculated in the subroutine fdfilt, in the program
fdcore.f, but I can't manage to get them out.
Any suggestion would be much appreciated
Thanks
Susana Barbosa
2009 Jul 31
2
merging two data frame with colomns of different length
Dear all,
I am trying to merge two data frames based on a common column but for this
common column both data frame do not have the same length and associated
information. I checked previous exemples in the list but was not able to apply
them in my case... Is someone know how to do that? Below is my code with the
expected result:
# data frame 1
Id1 <- c(1,1,1,2,2,2,3,3,3)
Habit1 <-
2007 Feb 15
2
How to add obj to a list?
Hello everybody!
I'm quite new using R and i'm trying to develope a function, but i have
a problem.
What i want to build is something like an objects vector. I have a list
with two tables, and after or next to them, I want to add more tables or
vectors to that list one by one. But i cannot find how to do it!
Does someone can help me?
I will be very grateful for any of your help!
1999 Oct 25
2
leaps: XHAUST returned error code -999
Hi there,
This problem has been dogging me for a bit, and I'm trying to
figure out why. When running the the subsets function in the leaps
library, R is giving me the following error message
> lvodsub <- subsets(pred, resp$LVOD)
Warning message:
XHAUST returned error code -999 in: leaps.exhaustive(a, really.big =
really.big)
but this still happens if I add the really.big option:
2013 Feb 26
1
cutreeDynamic error
I am having difficulty getting the dynamic tree cut package to work.
Given the data table "myddtable"
LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H
Blue23
I created a similarity matrix using DAISY and Gower metric and specified
Place and Color columns as characters (since they are categorical variables)
> dd.daisy<-daisy(myddtable, metric =
2011 Jan 31
4
Select rows with distinct values in a column and other conditions
My data frame looks like:
SightingID PA1 PA2 PlotID InOverlap Area1 2001 1 -99 392 Y 0.22 2002 1 -99 388 Y 0.253 2008 1 NA 104 N 0.344 2010 1 NA 71 N 0.185 2012 1 NA 61 N 0.166 2013 1 NA 61 N 0.227 2014 1 NA 62
2009 May 14
1
Supplying NA or Zeros in dataframe for missing factor combinations
Hi there,
I am not getting anywhere near a solution, so here is my question. I
have searched the archives and didn't find a solution, but maybe my
search didn't use the right words. So here it is:
I have a dataframe with the following structure
factor1 factor2 value
In the (rather large) dataset I have to work on, there are some factor
combinations missing, e.g.
factor1 <-
2012 May 11
1
Overlapping area script
Dear All
I would really appreciate some help with a script which a colleague wrote
for me (attached), but I am having problems running (and have not been able
to contact my colleague).
The script is designed to compare the area of suitable habitat in binary
projections of a large number of species current and future distributions,
and create an excel file detailing the total area suitable in the
2004 Apr 29
3
Dummies in R
Dear all,
my problem is following. I know Stata, but currently I have to use R. Could You please help in finding the analogy to R.
(1) creating of City-Dummy.
I know in Stata:
g byte city=0
replace city=1 if city==12&year==2000
and
(2) Create a Time-Dummy-Variable
g byte T2000=0
replace T2000=1 if year==2000
(3) I need the City DUmmy for the following combination: I have the