Displaying 20 results from an estimated 3000 matches similar to: "Newbie: Subsets of data frame"
2003 Feb 03
4
Overlaying a moving average curve on top of a barplot
I''m using standard barplot (Windows version 1.6.2 of R) to represent a certain weekly metric "v" and I would like to properly overlay on top of it its moving average "mean.8" (window of 8 weeks). I must be doing something wrong since the moving average (using "lines") doesn''t overlay properly, i.e., both x-scales do not match!
...
2003 Mar 14
2
plot
Can anyone tell me how to plot on the same graph two different functions
(of x) using two differnt y scales (axes 2 and 4)?
Thanks
Nelson
2002 Dec 13
2
A beginner's problems with plotting
Hi,
How would I go about plotting all 8 columns of a data.frame on a simple line
graph. i.e. eight lines and sets of points, differentiated by line pattern or
colour)?
An what further arguments would I need to invoke a log scale on the y-axis of
that same plot (normal x-axis)?
Cheers, Jeremy
2003 Jan 21
2
Plot using different symbols depending on value.
I am making a plot from R indicating an average, min and max value for a
number of sample types. as horizontal lines with the sample types on the
y-axis. (see http://home.newmedia.no/sickel/R.html for the plot and code) In
some cases, the min value is the detection limit, and I would like to
indicate that bu using a <, rather than the usual | I use for indicating the
value.
I am plotting each
2002 Sep 17
2
grid.legend - lines
I am testing out the grid-plots, but get into a problem making a legend. I
have a line plot and some points, following the model in
grid.plot.and.legend() i manage to get the points correctly in the legend,
but what do I do with the line? (Of cource, I can just draw a line at the
right location on the plot, but I would prefer to use legend)
Morten
--
Morten Sickel
Norwegian Radiation
2003 Jan 31
2
Varying texts in expression(paste())
Hi,
I am using R a lot to make plots relating to radioactivity, I am often using
expression() to label the plots with nuclide names written with
superscripts, e.g.
expression(paste("Releases of ", { }^{99},Tc," (TBq/year)"))->ywtext
But, is there any simple way to change the number and name of the nuclide
through a variable? I tried
nuccode=expression({ }^{99},Tc)
2005 Jun 22
2
Subsetting across a frame for plotting
I have a huge frame holding holding model results for a number of
locations and time series:
> str(tonedata)
`data.frame': 434 obs. of 339 variables:
$ VALUE : int 101 104 105 106 111 118 119 121 122 123 ...
$ COUNT : int 2443 184 1539 1016 132 1208 1580 654 864 560 ...
$ AREA : num 6.11e+08 4.60e+07 3.85e+08 2.54e+08 3.30e+07 ...
$ D1_1958 : num 470 446 452 457 407 ...
2002 Feb 26
1
Cross-tabulation of data from database
I am quite new to R, so please bear over with me if I have problems with the
R terminology.
I want to (try to) use R for some analyses within vegetation ecology, using
the vegan package. I have my data in a postgresql database, and I manage to
get them into R as a dataframe with columns for respectively: Name of the
analysed m2, Name of the species, coverage of species in the square in %. I
2003 Feb 20
3
Why does 'exists' need a quoted argument?
Some functions in R need quoted arguments. Consider this list:
help(rm)
rm(a)
is.na(a)
get("rm")
exists("rm")
Can someone explain why 'get' and 'exists' require quoted object names?
Would it make sense (more consistency) to have these functions check to see if the first argument is a string, and if not, then 'substitute' it? Intuitively,
2008 Oct 07
4
sort a list?
I am trying to sort a list and the data is obiously not in the right format. I am trying:
x <- list()
x[["A"]] <- 1
x[["B"]] <- 2
order(x)
But am getting:
Error in order(x) : unimplemented type 'list' in 'orderVector1'
How should I change the list so that it can be sorted? What kinds of objects (classes of objects) can be sorted?
Thank you.
Kevin
2012 Mar 18
2
word frequency count
Hi:
I have a dataframe containing comma seperated group of words such as
milk,bread
bread,butter
beer,diaper
beer,diaper
milk,bread
beer,diaper
I want to output the frequency of occurrence of comma separated words
for each row and collapse duplicate rows, to make the output as shown
in the following dataframe:
milk,bread 2
bread,butter 1
beer,diaper 3
milk,bread 2
Thanks for help!
deb
2007 Dec 29
15
Do you think it would look cleaner?
I was looking over some of my specs.
I was thinking that the following:
@game.should_receive(:name).and_return(''The Battle for Blaze'')
@game.should_receive(:people).and_return(5000000)
@game.should_receive(:activated).and_return(true)
Would it look cleaner if I could do this instead?
@game.should_recieve_and_return(
:name => ''The Battle for Blaze''
2007 Mar 10
2
barplot, for loop?
Hi R-users,
I have a dataset like this:
kuvaaja
kuva
yhteispisteet
Hannu
isokala
8
Hannu
kaapin alta löytynyt
2
Hannu
kaapin alta löytynyt 2
8
Hannu
limamikko
1
Hannu
maukasta marmeladia
8
Hannu
skrinnareita
4
Hate
madekoukkujen suojelupyhimys
3
Hate
matka aikaan joka ei enää palaa
3
Hate
munat puoliks padassa
6
Hate
pyynikki
2
Hate
vailla armeerausta
2
2002 Apr 30
3
Labeling matrix data
Hello all -
I am sorry if this simple question is addressed in somewhere else. But, I couldn't find it. It's been for about a week using R. . .
My problem is:
Reading matrix data with "scan" does not seem to allow me to incorporate matrix labels (columns, and rows).
If I use read.table, I can import the lables. But, the problem is, I don't know how I make this data as
2006 Nov 01
4
extract values from a vector
Hello,
I'm looking for a solution for the following problem:
I have two vectors
V1 <- c("apple","honey","milk","bread","butter")
V2 <- c("bread","milk")
now, I would like to know for each element in V1 if it's equal to one of
the elements in V2
I could do:
which(V1 == V2[1] | V1 == V2[2])
but what if I
2007 Mar 11
1
recoding question
Hi R-users,
I have a data frame like this:
photographer category picture points
Hannu kalat limamikko 1
Teemu kalat verkkovaja 3
Hate kalat munat puoliks padassa 6
Hannu kalat isokala 8
Teemu kasvit, sienet ja muut eliöt harppi 2
Hate kasvit, sienet ja muut eliöt pyynikki 2
Petteri kasvit, sienet ja muut eliöt harmaaleppä 5
Lauri kasvit, sienet ja muut eliöt lumipuu 9
Teemu linnut kainostelua 1
2015 Mar 26
2
Acceso gratuito durante un mes a la plataforma DataCamp...
Buenas a todos,
La gente de DataCamp se han puesto en contacto con el grupo de Madrid para
ofrecernos una oferta para usar gratuitamente su plataforma con diferentes
cursos de R durante un mes.
Les hemos preguntado si sería posible compartir este ofrecimiento con toda
la lista de R-Help-es y no ven mayor problema, les ha parecido muy bien la
posibilidad.
El link de acceso es el siguiente:
2007 Dec 12
2
Need good Reference Material and Reading about Gaussian Copulas
Can anyone advise me on some pratical papers or books
On Gaussian Copulas? Anything in the genre of Copulas Dummies
Would be a help.
As simpe, and approachable with minimal pedantic style.
Thanks,
Neil
--------------------------------------------------------
This information is being sent at the recipient's reques...{{dropped:16}}
2006 Nov 10
2
Searching for pyvorbis docs
Hello everybody!
I'am just leaning Python and wanted to write something useful for me, an
recursive masstagger for ogg-vorbis files.
My script uses pyvorbis 1.3 from the Debian testing tree. so far here is
my Problem:
The pyvorbis bindings aren't documented. As i understand the pyvorbis
package, this is a simpe 1:1 mapping to libvorbis.
dir(pyvorbins-oject) gives me an refernece to an
2013 Jan 02
2
Read many cvs files
Hello R helpers,
I would like to automate this code for many files of the same type. But I
don´t know how to make it. In particular, i don´t know how to read many
files each one as an r object with the name of the file. Then a for loop
would be sufficient, right?
Many thanks and a happy new year.
Dominic
datos <- read.table('global2001.csv',head=T,sep=';',stringsAsFactors=F)