similar to: Data reshaping with conditions

Displaying 20 results from an estimated 400 matches similar to: "Data reshaping with conditions"

2016 Apr 20
0
Data reshaping with conditions
Hi sri, As your problem involves a few logical steps, I found it easier to approach it in a stepwise way. Perhaps there are more elegant ways to accomplish this. svdat<-read.table(text="Count id name type 117 335 sally A 19 335 sally A 167 335 sally B 18 340 susan A 56 340 susan A 22 340 susan B 53 340 susan B 135 351 lee A 114 351 lee A 84 351 lee A 80 351 lee A 19 351 lee A 8 351 lee A
2016 Apr 21
2
Data reshaping with conditions
Hi Jim, Thanks for your time. But somehow this code did not help me to achieve my expected output. Problems: 1) x, y are coming as logical rather than values as I mentioned in my post 2) The values that I get for Max A and Max B not correct 3) It looks like a pretty big data, but I just need to concatenate the values with a comma, the final output will be a character
2016 Apr 21
0
Data reshaping with conditions
Hi sri, I think that I see what you mean. Your statements: x = Count_A_less_than_max of (Count type B) y = Count_A_higher_than_max of (Count type B). I took to mean that you wanted a logical value for x and y. Looking more closely at your initial message, I see that you wanted _all_ values of A with respect to maxB in x and y. The error with maximum values was due to a typo. Perhaps this will do
2016 Apr 21
0
Data reshaping with conditions
In R, square brackets [] are called "extraction operators" as they are interpreted so as to "extract" the parts of an object specified by the information within them. Your message contained only part of the line below: AltB<-svdatstr[row,indicesA][svdatstr[row,indicesA]<svdatstr[row,"maxB"]] Extraction operators may be specified sequentially or nested. Both
2010 Jan 10
1
scatterplot matrix with ggplot2
#I would like to use the below data to make a scatter plot matrix with #code similar to that below the data #conceptually this is the right approach I think #thanks in advance melt.gg <- structure(list(stream = c("Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonham Lower", "Bonham Lower",
2012 Jan 23
1
sqldf + Date class. Ordering and summary statistics appear to be incorrect.
I've been using sqldf heavily lately but have encountered problems with ordering of observations or calculating statistics such as max() and min() when the variable used is of class Date. For example, if I run the following code: =============== begin code ================= library(sqldf)
2003 Apr 02
19
Combining the components of a character vector
Dear Help, Suppose I have a character vector. x <- c("Bob", "loves", "Sally") I want to combine it into a single string: "Bob loves Sally" . paste(x) yields: paste(x) [1] "Bob" "loves" "Sally" The following function combines the character vector into a string in the way that I want, but it seems somewhat inelegant.
2009 Mar 11
3
Converting a dataframe to a matrix
If I have a dataframe which is organized like this: name color likes? 1 sally red 0 2 sally blue 1 3 sally green 1 4 jake red 0 5 jake blue 1 6 jake green 1 7 tom red 1 8 tom blue 0 9 tom green 0 And I want to create a matrix in the form: red blue green sally 0 1 1 jake 0 1 1 tom 1 0 0 Are there any built-in
2006 Oct 27
1
how to draw histograms on multiple variables in a graph?
for example, I have two sets, x and y. I want to draw their histograms using different colors in a graph. I didn't find how to do this by reading ?hist Thanks very much. [[alternative HTML version deleted]]
2010 Jul 31
3
Installing iTunes on Linux Mint Isadora 9
Hi all, I have downloaded the latest version of wine in order to run iTunes but when I tried to execute the program here is what I get : cd /home/sally/Documents $ wine iTunes64Setup.exe Trying to load PE image for unsupported architecture (AMD-64) err:process:create_process starting 64-bit process L"Z:\\home\\sally\\Documents\\iTunes64Setup.exe" not supported on this platform wine:
2009 Nov 23
4
Check if string has all alphabets or numbers
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091123/470946bc/attachment-0001.pl>
2008 Mar 05
4
vertex labels in igraph from adjacency matrix
I am getting some unexpected results from some functions of igraph and it is possible that I am misinterpreting the vertex numbers. Eg., the max betweenness measure seems to be from a vertex that is not connected to a single other vertex. Below if my code snippet: require(igraph) my.graph <- graph.adjacency(adjmatrix = my.adj.matrix, mode=c("undirected")) most.between.vert <-
2017 Oct 10
2
small files performance
2017-10-10 8:25 GMT+02:00 Karan Sandha <ksandha at redhat.com>: > Hi Gandalf, > > We have multiple tuning to do for small-files which decrease the time for > negative lookups , meta-data caching, parallel readdir. Bumping the server > and client event threads will help you out in increasing the small file > performance. > > gluster v set <vol-name> group
2008 Jan 31
2
request to install app
Hi, I would like to generate a facebook call on behalf of a user to create a request to another user to install the app. Is there a way to do this without being in a fb_request_form? the use case is: Fred is creating a task, he assign it to a friend Sally , if Sally has already installed & setup my app, no problem, if she hasnt, I want to send an add request from Fred along with
2009 Feb 15
1
Delete row if first letter of row name is
Hello! I am still a beginner. Can you tell me how to delete a row (from a matrix or data.frame) if the row name starts with U? See example below: U179971039 0.058663 0.087575 empty1 -0.1296 -0.09105 empty2 0.136259 0.398073 empty3 0.446041 -0.33997 Sally [[alternative HTML version deleted]]
2012 Feb 01
3
Probit regression with limited parameter space
Dear R helpers, I need to estimate a probit model with box constraints placed on several of the model parameters. I have the following two questions: 1) How are the standard errors calclulated in glm (family=binomial(link="probit")? I ran a typical probit model using the glm probit link and the nlminb function with my own coding of the loglikehood, separately. As nlminb does not
2011 Nov 07
2
logistric regression: model revision
Hello, I am working on fitting a logistic regression model to my dataset. I removed the squared term in the second version of the model, but my model output is exactly the same. Model version 1: GRP_GLM<-glm(HB_NHB~elev+costdis1^2,data=glm_1,family=binomial(link=logit)) summary(GRP_GLM) Model version 2: QM_1<-glm(HB_NHB~elev+costdis1,data=glm_2,family=binomial(link=logit))
2011 Oct 17
3
Importing all observations and variables from csv file into dataframe
Hello, I need some help getting started with data analysis. I’m having trouble getting R to read my data file. I’ve referred to various R help documentation, the website, and FAQs, but I don’t see my situation listed. I saved an Excel file (post-2007 Excel version) of data as a “.csv” file. However, the file still appears in column format when I open it. Does that happen when you save a an
2009 May 22
2
System crash when using surv=T in cph
Can someone help me. I am very new to R. I am fitting a Cox model using Frank Harrell's cph as I want to produce a Nomogram. This is what I have done: Srv<- Surv(time,cens) f.cox<- cph(Srv~ v1+v2+v3+v4, x=T, y=T, surv=T) As soon as I press enter, Windows XP crashes. If I remove surv=T, then it works. I have R version 2.9.0. Is there a way of displaying the parameter estimates (ie beta
2008 Nov 14
2
GAM and Poisson distribution
Hi -I'm running a GAM with 7 explanatory variables with a Poisson error structure. All of the variables are continuous so I'm getting error messages in R. cod.fall.full.gam.model<-gam(Kept.CPUE~s(HOUR)+s(LAT_dec)+s(LONG_dec)+s(meantemp_C)+s(meandepth_fa)+s(change_depth)+s(seds), data=cod.fall.version2,family=poisson) In dpois(y, mu, log = TRUE) ... : non-integer x = 5.325517