search for: kirshna

Displaying 20 results from an estimated 40 matches for "kirshna".

2012 Nov 17
3
Reshaping a dataframe
Seems like this should be easy but I'm struggling a bit. How do I rearrange a data frame to go from the first one to the second shown below ? State Date lbs TX 200701 400 TX 200702 650 TX 200703 950 TX 200704 1000 FL 200701 200 FL 200702 300 FL 200703 500 FL 200704 333 NJ 200701 409 NJ 200702 308 NJ 200703 300 NJ 200704 800 Date TX FL NJ 200701 400 200 409 200702 650
2012 Oct 17
3
subtotals based on price bands?
I would like to create a subtotal table with custom bands. seq1 = seq(0, 100, by = 5) seq2 = seq(100, 1000, by = 100) Bands = c(seq1, seq2) #Prices Prices = sample(1:1000, 200, replace=F) #corresponding size for the given price above. size = sample(1:1000, 200, replace=F) How would I find the subtotal of the size based on a given price falls within a band? -- View this message in
2012 Nov 10
3
matrix of all difference between rows values
Hello all, i would like to calculate the difference of all row values and the others row values from my matrix (table 1). The output (table 2) would be a matrix with input matrix's row names on row names and colums names, thereby the difference values among two of the row names could be bether found. Could someone help me? Examples: Table 1: a 10 b
2013 Jan 27
1
Removing values containing a specific character
Awesome, thanks Arun, that's exactly what I was looking for! On Sat, Jan 26, 2013 at 9:21 PM, arun kirshna [via R] < ml-node+s789695n4656749h63@n4.nabble.com> wrote: > Hi, > Try this: > df[]<-lapply(df,as.character) > df2<-df > df[,1][grep("@",df$names)]<- "" > df > #names emails > #1 bob bobj@cup.com > #2 joe joesmit...
2013 Jan 20
1
applying a formula from text
...e to help me. Thank you really. Concerning your question why I need it, I think that it can be situations where the condition, that I have to apply, depends on the data. May be you can advice me a good text to learn programming in R. Thank you again. Ilya Novikov Sat, Jan 19, 2013 at 8:02 PM, arun kirshna [via R] < ml-node+s789695n4656060h99@n4.nabble.com> wrote: > HI, > Not sure why you need to do this: > s<- "x>5" > h(1,eval(parse(text=s))) > #[1] FALSE > A.K. > > ------------------------------ > If you reply to this email, your message will be...
2013 Mar 21
1
plot and save as png
...[3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.15.1 > On Mon, Mar 18, 2013 at 6:36 PM, arun kirshna [via R] < ml-node+s789695n4661660h40@n4.nabble.com> wrote: > Hi, > > Couldn't reproduce your problem. > Using your code, I am getting the image below: > A.K. > > > ------------------------------ > If you reply to this email, your message will be added to the d...
2013 Mar 21
2
Displaying median value over the horizontal(median)line in the boxplot
...? ? 7 Finally how do I control the output. My actual data has a median value of 7.642552 but I only want it to be displayed as 7.6. Thank you so much for your help. I am very sorry for troubling you but I am very very new to this programming and to R as you can see. <quote author='arun kirshna'> Hi, Lines1<-readLines(textConnection("Column1 -1,2,3,4,5,6,6,7 COlumn2- 3,4,5,6,7,8,8 Column3-- 45,66,7,8,89, COlumn4-5,6,7,7,8,9 Column5 -5,6,7,8,8")) vec1<-unlist(strsplit(Lines1,"-")) dat1<-as.data.frame(t(read.table(text=vec1[grepl(",",vec1)],se...
2012 Nov 12
3
select different variables from a list of data frames
Hi: How do I select different variables from a list of data frames. I have a list of 13 that looks like below. Each data frame has more variables than I need. How do I go through the list and select the variables that I need. In the example below, I need to get the variables "a", and "q10" and "q14" to be returned to two separate data frames. Thank you. Yours, Simon
2012 Sep 11
5
Searching from Dataframe.
Hi, i have a dataframe containing some values. for eg:- MyDataFrame<- Name Age Place ------- ------ ----------- Aby 12 USA Raj 25 UK Romi 32 ENG Amy 31 IND My requirement what is, i have a search key word[it should search from all the columns], that i need to find out from this dataframe. If search keyword found , it
2012 Nov 22
4
Using cumsum with 'group by' ?
Hi, First post here. Grateful for any help you can give. I have data which looks like this: id time x 1 12:01 5 1 12:02 14 1 12:03 6 1 12:04 3 2 12:01 98 2 12:02 23 2 12:03 1 2 12:04 4 3 12:01 5 3 12:02 65 3 12:03 23 3 12:04 23 But I want to add a column which is the cumulative sum of X, but only by id. I've used cumsum before, but not
2012 Oct 12
7
ifelse reformulation
Hi, i'm trying to simplify some R code but i got stucked in this: test<-data.frame(cbind(id,x1,x2,x3,x4,x5,x6,x7)) test > test id x1 x2 x3 x4 x5 x6 x7 1 1 36 26 21 32 31 27 31 2 2 45 21 46 50 22 36 29 3 3 49 47 35 44 33 31 46 4 4 42 32 38 28 39 45 32 5 5 29 42 39 48 25 35 34 6 6 39 31 30 37 46 43 44 7 7 41 40 25 23 42 40 24 8 8 27 29 47 34 26 38 28 9 9 25 35 29 36
2013 Feb 01
29
cumulative sum by group and under some criteria
Thank you very much for your reply. Your code work well with this example. I modified a little to fit my real data, I got an error massage. Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) : Group length is 0 but data length > 0 On Thu, Jan 31, 2013 at 12:21 PM, arun kirshna [via R] < ml-node+s789695n4657196h87@n4.nabble.com> wrote: > Hi, > Try this: > colnames(d)<-c("m1","n1","x1","y1","p11","p12") > library(zoo) > res1<- do.call(rbind,lapply(lapply(split(d,list(d$m1,d$n1)),functio...
2008 Mar 10
1
state space model for poisson distribution
Hi Rers, I have a poission time series model with 5 parameters. I just wanted to remove two of the lag on response in the model and put it as a system model. I am not sure about the codes to combine these two on R. If anybody has any R example (code), please post it. My original model: log(Y(t))~constant+b1*Y(t-1)+b2*Y(t-2)+b3*(variable1)+b4*(variable2)+e I would like to construct a
2012 Aug 02
1
sapply and matrix command
...26 1 [[25]] [,1] [,2] [1,] 1 22 [2,] 22 1 A.K. ______________________________________ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/sapply-and-matrix-command-tp4637769p4638821.html This email was sent by arun kirshna (via Nabble) To receive all replies by email, subscribe to this discussion: http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=subscribe_by_code&node=4637769&code=ci1oZWxwQHItcHJvamVjdC5vcmd8NDYzNzc2OXwtNzg0MjM1NTA4 [[alternative HTML version deleted]]
2012 Dec 06
0
Summary command: Two independent variables against dependent.
Brilliant, thanks very much!! Works fine. Dan On 6 Dec 2012, at 18:25, arun kirshna [via R] wrote: > Hi, > Your question is not very clear. I hope you are not looking for the subset option in summary(lm()). > If you want just the summary(), then use '&' or '|' > For e.g. > dat1<-read.table(text=" > opcorn Oilamt Batch...
2013 Feb 20
0
subsetting with greater than and less than indexing
...ance. I'm sorry that I did not provide a reproducible example. I will provide a reproducible example the next time. Using the next to last line of your code I was able to get what I needed without using the for loop. Thanks again. Irucka <-----Original Message-----> >From: arun kirshna [via R] [ml-node+s789695n4659154h50@n4.nabble.com] >Sent: 2/20/2013 8:49:22 AM >To: iruckaE@mail2world.com >Subject: Re: subsetting with greater than and less than indexing > >Hi, >It is better to provide a reproducible example. So, not sure about the problem > >Using anot...
2013 Mar 21
0
how do I read certain files from a directory based on number of columns?
Hi Arun, thank you. I will look through that later on today when I get a chance. I have to complete another part of this project now. Irucka <-----Original Message-----> >From: arun kirshna [via R] [ml-node+s789695n4661145h71@n4.nabble.com] >Sent: 3/12/2013 10:35:39 PM >To: iruckaE@mail2world.com >Subject: Re: how do I read certain files from a directory based on number of >columns? > >Hi, >Suppose, I have three files "File1.txt", "File2.txt",...
2013 Mar 11
0
splitting column into two
...split(CTSS$V4, ' ', c('peak_start', 'peak_end')) ) but instead of replacing the column it keeps it the same and adds two new columns at end of the columns(after 625 columns). Please let me know if you have a better solution. Thank you, Nanami <quote author='arun kirshna'> Hi, May be this helps: dat1<-read.table(text=" 0111 0214 0203 0404 1112 0513 0709 1010 0915 0813 0112 0314 0204 0504 1132 0543 0789 1020 0965 0823 ",sep="",header=FALSE,colClasses=rep("character",10)) res<-do.call(data.frame,lapply(dat1,function(x) do....
2012 Nov 04
2
Replacing a string
Hi, I have what I hope is a simple text processing question in R. I want to replace every instance of http:\\XXX.com with "WEBSITE" When I try sub('(^http://)(.com$)', 'WEBSITE', <filename>);, it only substitutes http:// and .com so it looks like WEBSITEXXXWEBSITE How do I get it to match the pattern "http:// . . . . .com" and substitute the whole
2013 Apr 12
2
processing matrix equation derived from rows of two matrices
Hi, May be this helps: ?tb[1,]%*%(((val-rep(meansb79[1,],5))^2)/6) #??????? [,1] #[1,] 1.47619 tryvarb<-c(1,2,3,4,4,4,4) ?var(tryvarb) #[1] 1.47619 tb[2,]%*%(((val-rep(meansb79[2,],5))^2)/6) #???????? [,1] #[1,] 1.904762 sapply(seq_len(nrow(tb)),function(i) tb[i,]%*%(((val-rep(meansb79[i,],5))^2/6))) # [1] 1.4761905 1.9047619 1.9047619 1.9047619 1.9047619 2.2857143 1.9047619 # [8] 1.9047619