Displaying 20 results from an estimated 9000 matches similar to: "Subset any value and blanks"
2008 Nov 24
4
Replace NaN with zero
I need help with replacing NaN with zero (the value '0') in my dataset.
The reason is that I can't get it to graph because of the NaN in the
dataset. I have tried:
data[is.nan(data)] <- 0
that others have suggested in the help archives but this does nothing so
I am not sure what I am doing wrong.
Thanks in advance for your help.
[[alternative HTML version deleted]]
2007 Jun 20
3
Replace number with month
Hi all
I have a multiple datasets that look like this
MM Freq
1 30
2 35
3 54
4 33
5 27
6 13
7 25
8 29
9 40
10 32
11 36
12 23
I am plotting this using barchart (there is probably something better
but it gives me the results I want) and I would like the x-axis to have
the names of the months instead of the month numbers. So I have
2007 Apr 25
1
Sum of specific column
I have a data set that I have imported (not sure if that makes a
difference) and I would like to calculate the sum of only specific
columns. I have tried
>colSums(dataset, by=list(dataset$col5), dims=1) and I get an error of
unused arguments
I have also tried
>aggregate(dataset, by=list(dataset$col5), sum) and I get the error that
sum is not meaningful for factors.
I want to only calculate
2007 May 10
1
Barplot by two variables
Hi all
I have a bit of a problem. I want to make a barplot of some data. My
data is of a score that is separated by year and by a limit (above 3 and
below 3 to calculate the score).
Year Limit HSS
1999 ALT 0.675
1999 VFR 0.521
2000 ALT 0.264
2000 VFR 0.295
I would like to have a barplot with year on the x axis and HSS on the y
axis and the two limits as two different colors to show the
2007 May 15
1
How to group a count
Hello R users
I have a dataset that has different types of records with different
dates and times pertaining to each. I would like to have a bar graph of
a count of the types(ie. The number of types) of recods by hour grouped
by year. So the count of the types would be the y axis, the hour on the
x axis and then grouped by year for easy comparison. I think that I
have to use barchart however I
2007 Jun 22
1
Barchart legend position
I am using barchart to make charts for some data with a lot more
functions and labels and such in the command.
barchart(Freq ~ factor(HH), data = dataset1, group= year)
So I have my data grouped by year and I get a legend at the top of
graph, which is great cause I need the legend for the different years
but it is a weird spot. So how can I manipulate the legend, ie. Move
it, shrink it, do
2007 Dec 19
1
adding lines to a barchart
Hi all
I can't find what I am looking for so I am asking here. I have a
dataset that looks something like this.
Year season percent_below
2000 Winter 6.9179870
2000 Spring 1.6829436
2000 Summer 1.8463501
2000 Autumn 3.8184993
2001 Winter 2.8832806
2001 Spring 2.5870511
2001 Summer 0.0000000
2001 Autumn 4.7248240
2002 Winter
2007 Jun 29
1
Assign name to a name
I would like to know how I can assign a name to a name. I have a
dataset that has different years in it. I am writing scripts using R
and I would like to give a month a generic name and then use the generic
name to do different analysis. The reason for the generic name would be
so that I only have to change one thing if I wanted to change the year.
For example.
Year1 = 1999
datayear <-
2008 Jan 23
1
Bar width and labels in barchart
Hi everyone
I am using barchart to make my graphs. Here is my code.
barchart(percent_below ~ factor(Year)| factor(Season,
levels=unique(Season)),
data= .season_occurrence, origin = 0, layout = c(4, 1),
scales=list(tick.number=ticknum,labels=NULL), ylim=c(0, ymax),
group = factor(Year), xlab= "Year", auto.key = list(points =
FALSE, rectangles =
2007 Apr 11
2
Looping through series of names
Hi
I am very new to R and have not able to find the answer to my question
in the manual or any other post. I have a dataset that has various
different sites names with data relating to each site. The data is in
one dataset. I want to loop through the different site names and
perform my test on each site. The sites are named not numbers for
example "YYC". How do I do this. I hope I
2002 Dec 31
3
Probit Analysis
Hello all,
I have a very simple set of data and I would like to analyze them with
probit analysis.
The data are:
X Event Trial
100 8 8
75 8 8
50 6 8
25 4 8
10 2 8
0 0 8
I want to estimate the value of X that will give a 95% hit rate
(Event/Trial) and the corresponding
95% CI. Anyone can offer some help? Thanks!!
-
2008 Oct 23
2
map points from scatterplot3d onto 2d fitted plane
Dear R helpers,
I have a 3D scatter plot that I have generated from scatterplot3d (which
looks great- thanks!) and I can see that the points in my graph fall in a
plane.
Following the example 5 from 3D scatter plot (below) I have fitted a
regression plane.
Now what I would like to do is a rotation so that my new co-ordinate system
is about the fitted plane (by finding the normal to the plane
2011 Oct 02
2
subset in dataframes
I need help in subseting a dataframe:
data1<-data.frame(year=c(2001,2002,2003,2004,2001,2002,2003,2004,
2001,2002,2003,2004,2001,2002,2003,2004),
firm=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),x=c(11,22,-32,25,-26,47,85,98,
101,14,87,56,12,43,67,54),
y=c(110,220,302,250,260,470,850,980,1010,140,870,560,120,430,670,540))
data1
I want to keep the firms where all x>0 (where there are
2007 Oct 29
2
homes directory visible only for one user
Hi!
I'm kinda new, so i'm wondering how should i configure [homes] section, so
only two of many users (e.g. "user1" and "user2") could see it shared in
network (so only those users could access their homes)?
thanks in advance, andrej
2010 Jun 09
1
Subset columns by prefix
Hello R listserve,
I would appreciate someone's help with this problem. Consider the following toy dataset:
x <- read.table(textConnection("worldclim.1 worldclim.2 cru.1 cru.2
indv.1 7 8 32 658
indv.2 7 7 39 422"), header = TRUE)
How could I create a subset of the data based on the column prefix? For instance, let's say I wanted to subset only the columns with the
2004 May 11
1
stability measures for heirarchical clustering
Dear R users,
I'm interested in measuring the stability of a heirarchical clustering, of
the overall clustering and finding sub clusters (from cutting the
heirarchical clustering at different levels) which demonstrate stability.
I saw some postings on the R help from a while back about bootstrapping for
clustering (using sample and generating a consesus tree with a web based
tool CONSENSE)
2011 Sep 01
2
Help with creating date as POSIXct
Dear list,
I want to create a POSIX time vector as follows:
day <- as.character("110809")
time.t <- 1:3600
t.min <- time.t %/% 60
t.sec <- time.t-t.min*60
DATE <- as.POSIXct(strptime(paste(day,t.min,t.sec),"%y%m%d %M%S"))
Tail(DATE)
The problem is that the last element (3600) returns a NA and I don't
understand why. 600, 1200, 2400
2017 Nov 29
3
Removing a data subset
Say I have a dataset that looks like
Location Year GW_Elv
MW01 1999 546.63
MW02 1999 474.21
MW03 1999 471.94
MW04 1999 466.80
MW01 2000 545.90
MW02 2000 546.10
The whole dataset is at http://doylesdartden.com/ExampleData.csv
and I use the code below to do the graph but I want to do it without MW01.
How can I
2002 Jun 14
2
combination of different vector values
Hi,
Thanks in advance for the help.
I have a few vectors and I need to get all the combinations of the vector
values.
Normally I would use a few for-loops to do that.
e.g x1_c(1,3,5)
x2_c(2,5,6)
for (i in x1) {
for (j in x2) {
...
}}
My problem is that I don't know how many vectors there are ahead of time,
so
I don't know how many for-loops I need. Any
2011 Oct 25
4
comparing two tables
Hi everybody,
I would like to know whether it is possible to compare to tables for certain
parameters.
I have these two tables:
gene table
name chr start end str accession Length
gen1 4 646752 646838 + MI0005806 86
gen12 2L 243035 243141 - MI0005821 106
gen3 2L 159838 159928 + MI0005813 90
gen7 2L