similar to: extract integers from string

Displaying 20 results from an estimated 2000 matches similar to: "extract integers from string"

2011 Oct 14
4
using do.call to call a list of functions
I am having trouble figuring out how to use do.call to call and run a list of functions. for example: make.draw = function(i){i;function()runif(i)} function.list = list() for (i in 1:3) function.list[[i]] = make.draw(i) will result in > function.list[[1]]() [1] 0.2996515 > function.list[[2]]() [1] 0.7276203 0.4704813 > function.list[[3]]() [1] 0.9092999 0.7307774 0.4647443 what I
2013 Mar 05
3
Simulate binary correlated data
Dear R experts, I am trying to simulate correlated binary data and have stumbled upon the following problem: With the help of "binarySimCLF" or "mvpBinaryEp" I have been able to simulate correlating binary vectors given certain mean values and a desired correlation. My problem is that these procedures do not allow you to specify the exact vector for which you want to generate
2007 May 12
1
mtrace() fails
I find the R debug package very useful. I've installed and used it on several of the machines I use, without problems, but on one machine I get the following error: Loading required package: mvbutils Loading required package: utils MVBUTILS: no "tasks" vector found in ROOT Loading required package: tcltk Loading Tcl/Tk interface ... done [Previously saved
2011 Oct 05
4
dynamically creating functions in r
it is possible to dynamically create functions in R using lists? what I want to do is something like this: a = list() for (i in 1:10) a[[i]] = function(seed = i) runif(seed) so that when I call a[i] I get random draws 1,2,....i unfortunately R only uses the last i . I would also like to know if there is a run-all function without explicitly looping or using lapply. for example if I
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",
2005 Jun 28
3
Help with stripplot
For the following code is there a way to make the jitter all line up horizontally, instead of them being just randomly spread around a value. So for ex if there are multiple values at 63 for genotype wt then all the values should be plotted on the same y value of 63 but spaced apart by a certain factor or noise.. library(lattice); dataFrame <- as.data.frame(t(structure(c( 64,'wt',
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
2011 Dec 17
0
Registry entry to change MIDI mapper changed?
I'm trying to get the MIDI music for the 1996 SegaSoft game Lose Your Marbles (http://appdb.winehq.org/objectManager.php?sClass=version&iId=9196) working. The game itself remains Platinum under 1.3.34-- it runs great, without any overrides, and the sound effects work fine too... it's just the MIDI music that does not play, or rather, is not heard. I went to the Wiki and performed all
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:
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
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.
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 20
2
Data reshaping with conditions
Dear All, I am trying to reshape the data with some conditions. A small part of the data looks like below. Like this there will be more data with repeating ID. 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 21 351 lee A 88 351 lee B 111 351
2005 Jun 30
1
FW: plot legend outside the grid
-----Original Message----- From: Ghosh, Sandeep Sent: Thursday, June 30, 2005 5:43 PM To: 'Berton Gunter' Subject: plot legend outside the grid Thanks for the pointers... I managed to get everything to look and feel the way I want except for the legend to plot outside the grid... Thanks for the note on the par, but I'm not able to it to plot outside the plot grid.. dataFrame <-
2006 Mar 17
3
Binning question (binning rows of a data.frame according to a variable)
Hi, I have tuples of data in rows of a data.frame, each column is a variable for the 'items' (one per row). One of the variables is the 'size' of the item (row). I would like to cut my data.frame into groups such that each group has the same *total size*. So, assuming that we order by size, some groups should have several small items while other groups have a few large
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]]
2003 Jan 27
1
more info - NT_STATUS_ACCESS_DENIED opening remote file
Thanks to those who had suggestions on my last post, but none of those seems to have worked. I have narrowed down the problem a bit though, seems users can't write to a share that is not their primary group. For example: Bob's primary group is Bob and secondary group is Sally. Bob can write to the Bob group share but not the Sally group share. Anymore thoughts/suggestions. Thanks
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))
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