Displaying 20 results from an estimated 10000 matches similar to: "Dont show zero values in line graph"
2010 Nov 29
3
List elements of NULL to value
Hi everyone,
I am posting this because i know its easy and i cant for the life of me
figure out how to do it though i have tried and through a ridiculously
complex loop made it happen. I need to convert some list elements of NULL
value to 0s so they mesh with my data frame properly. So for
A<-list(1,NULL)
returns
[[1]]
[1] 1
[[2]]
NULL
Would instead return
[[1]]
[1] 1
[[2]]
[1] 0
2012 Feb 06
5
I bet apply has a solution
Hi all
For the data below, I would like to return a logical value indicating
differences in the data.
#Create data
Data..<-data.frame(a=rep(1,10),b=c(rep(1,9),2),c=c(rep(1,8),2,2))
a b c
1 1 1 1
2 1 1 1
3 1 1 1
4 1 1 1
5 1 1 1
6 1 1 1
7 1 1 1
8 1 1 1
9 1 1 2
10 1 2 2
So what I want is to return logical value telling me if all the values are
the same. So the result would be a b
2012 Oct 11
3
Sorting a data frame by specifying a vector
Hello all,
I cannot seem to figure out this seemingly simple procedure.
I want to sort a data frame by a specified character vector.
So for :
df.. <- data.frame(Season=rep(c("Summer","Fall","Winter","Spring"),4),Obs=
runif(length(rep(c("Summer","Fall","Winter","Spring"),4))))
I want to sort the data frame
2010 Jan 12
5
Drop last numeral
Hello all,
Frustrated and i know you can help
I need to drop the last numeral of each of my values in my data set. So for
the following i have tried the ?substring but since i have to specify the
length, but because my data are of varying lengths it doenst work so well
Data<-c("1131", "1132", "1731" ,"1732" ,"1821" ,"1822",
2011 Dec 06
2
To Try or to TryCatch, I have tried to long
So after about 4 hours struggling with Try and TryCatch I am throwing in the
towel. I have a more complicated function that used logspline through
iterative distributions and at some point the logspline doesnt function
correctly for some subsets but is fine with others so I need to be able to
identify when the error occurs and stop curtailing the distribution and I
think this Try or TryCatch
2010 May 28
1
Data frame manipulation
Hello All,
Please consider the following:
TotEmp<-c(19,6,1,1,8,44,2,33,48,1)
ClusterType<-c("AGF","CNS","OSV","RTL","RTL","TRN","REL","ACC_CLUST","RTL","WHL")
Taz<-c(0,0,0,100,100,100,101,101,102,103)
2011 Dec 01
2
Summarizing elements of a list
Hi everyone,
I looked around the list for a while but couldn't find a solution to my
problem. I am storing some results to a simulation in a list and for each
element i have two separate vectors(is that what they are called, correct my
vocab if necessary). See below
Version1_<-list()
for(i in 1:5){
Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1))
}
What I want is to put all
2010 Oct 28
4
Alter character attribute
Hi everyone
I have some records that include a date attribute for the date and time but
i need to separate the data and analyze it separately in GIS by Month and
Year, so i need to pull these attributes out and create their own attribute
field.
So the input:
RawData2.. returns
ID period_end_date
1 22 9/10/2007 0:00:00
2 44 2/2/2006 0:00:00
and i need to get
ID period_end_date
2010 Jun 03
2
Subsetting for unwanted values
Hi all,
I have toyed with this for too long today and in the past i used multiple
lines of code to get at what i want. Consider the following:
All i need to do is subset Pc to the values that do not equal Pc.X. The
first attempt doesnt work because i have unequal lengths. The second
attempt doesnt give me an the right answer.
2010 Aug 09
4
Pie Chart in map
Hey R'rs,
So im sick of dealing with ESRI products and am looking to stream line a
process i now use GIS to do using R. I have made a lot of maps using R but
have not yet seen a map that puts pie charts within the map to help
represent data like the attachment.
http://r.789695.n4.nabble.com/file/n2318816/template1.bmp
I found Tanimura et al. work "Proportional Symbol Mapping in
2010 Mar 04
2
Removing colon from numerical data
Basic question, looked through the forum and documentation but didnt see a
solution.
So consider
O<-c(1:20)
D<-c("1:","2:","3:","4:","5:","6:","7:","8:","9:","10:","11:","12:","13:","14:","15:","16:",
2011 May 17
4
Summarize by two or more attributes
Okay everyone heres a likely softball for someone.
Consider the following data frame:
#Create data
x<-rep(c(1,15),10)
y<-rnorm(20)
z<-c(rep("auto",10),rep("bus",10))
a<-rep(c(1,1,2,2,3,3,4,4,5,5),2)
#Create Data frame
Df<-data.frame(Source=x,Rate=y,Bin=a,Type=z)
I want to create a new column the equals the sum of the Rates for each type
(1,15) by Bin.
A
2011 Sep 01
3
Oh apply functions, how you confuse me
Hi guys,
I have a crap load of data to parse and have enjoyed creating a script that
takes this data and creates a number of useful graphics for our area. I am
unable to figure out one summary though and its all cause I dont fully
understand the apply family of functions. Consider the following:
#Create data
2012 Jun 20
2
Using object as literal value in list vector
Hello all ,
This is a pretty simple question I think but cannot find an answer on the
list or in my brain. I would like to iterate through a loop and use a
vector of strings to name a number of list elements. For instance
#Create vector of strings
Et<- c("ACC","RTL","WHL")
MeanValues_ <- list("ACC" = 1000, "RTL" = 2000,
2010 Jan 25
3
Issue using tapply
Hello all,
I am trying to use the tapply function to sum some values and change the
column names of the resulting vector.
I input
Emp Et
1 10565 ACC
2 7515 ADM
3 625 AGF
4 6243 CNS
5 12721 EDU
6 3924 FIN
7 18140 HLH
8 3686 INF
9 15841 MFG
10 243 MIN
11 1864 MNG
12 4664 OSV
13 5496 PRF
14 4988 PUB
15 2166 REC
16 2153 REL
17 16082 RTL
18 3582 TRN
19 757 UTL
20
2011 Mar 22
2
Loading mdb
Well im thoroughly frustrated after 25 minutes of checking and rechecking my
path. What do i not know about loading a mdb that is keeping me from
loading my data.
i have loaded the Hmisc library and pointed it too my data using mdb.get and
continue to get the following error.
Error in system(paste("mdb-tables -1", file), intern = TRUE) :
'mdb-tables' not found
Which i
2010 Mar 10
1
trouble getting multinimial logit model to work properly
Greetings all,
please consider the following data:
#Build Data frame
Slope<-c(1.291370, 12.208500, 2.110930, 0.578990, 5.019520, 0.807444,
0.554079
, 1.257080, 0.241504 , 0.184337 , 0.383044 , 0.342021)
Exposure<-c(790.54, 1167.79 , 845.58 , 1082.47 , 1189.61 , 677.17 ,
2058.56 , 469.09
, 112.02 , 803.31 , 254.14 ,1336.16)
FwyDist<-c(11809.4222 ,10623.0458, 12279.6271,
2010 Sep 13
1
Transforming character vector
Hi guys,
Cant seem to find a solution for this. I am looking for a substitute for
cut that can transform character vectors. So as cut would be used below to
transform YearCat-> YearCat2 base on Year and vector
Ag<-c("00-'70","'71-'75","'76-'85","'86-'09") using 'cut '
2010 Oct 26
1
Cut including the 0 value as separate bin
Hi everyone,
I have been using R too long to have to ask this but here i am. How do i
create a separate bin for the 0 value? So for:
#Create data frame
DF<-data.frame(A=0:20)
#Create label vector
labs<-1:6
#Create buckets and label
DF$Cut<-cut(DF$A,c(0,4,8,12,14,16,20),labels=labs,include.lowest=TRUE)
I want the 0(zero) value to be in a separate bin.
Sorry for the lame post...
2010 Feb 23
1
select row based on highest value
Please consider the following
#Data to use
Props<-c("p754921","p754921" ,"p754921","p75506" ,"p75506"
,"p75506","p75506","p75508","p75508","p75508","p75508","p75508")
TAZ<-c(38,37,37,171,171,282,171,46,46,169,169,169)
Area<-c(109828.04, 128134.71, 46469.57,