similar to: split list of characters in groups of 2

Displaying 20 results from an estimated 20000 matches similar to: "split list of characters in groups of 2"

2011 Jul 06
3
identifying a 'run' in a vector
Hi, How can I discern which elements in x (see below) are in 'order', but more specifically.. only the 1st 'ordered run'? I would like for it to return elements 1:8... there may be ordered values after 1:8, but those are not of interest. x <- c(1, 2, 3, 4, 5, 6, 7, 8, 20, 21, 22, 45) Thanks for any suggestions. -- View this message in context:
2011 Dec 02
2
Moving column averaging
# need zoo to use rollapply() # your data (I called df) df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", "e", "f"), class = "data.frame", row.names = c(NA, -2L)) # transpose and make a zoo object df2 <- zoo(t(df)) #rollapply to get
2012 Jan 23
1
R not giving significance tests for coefficients/estimates?
> 3x4 Error: unexpected symbol in "3x4" R has no idea that you equate "x" as multiplication.. use an astrix > 3*4 [1] 12 dominic wrote > > This is basically my code: > > library(MASS) > lmsreg(formula = b0 ~ b1 + b3 + b1xb2, data=mydata) > > b1xb2 is an interaction but it was the centered value for a continuous > variable times a
2011 Sep 07
1
reshaping data
I have the following data (see RawData using dput below) How do I get it in the following 3 column format (CO2 measurements are the elements of the original data frame). I'm sure the package reshape is where I should look, but I haven't figured out how. Thanks ahead of time Month Year CO2 J 1958 F 1958 M 1958 315.71 A 1958 317.45 M.1 1958 317.5 J.1 1958 J.2 1958 315.86 A.1 1958
2011 Nov 24
4
I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?
Hi, First I should note I am relatively new to R so I would appreciate answers that take this into account. I am trying to perform an MDS ordination using the function ?metaMDS? of the ?vegan? package. I want to ordinate species according to a set of functional traits. ?Species? here refers to ?sites? in traditional vegetation analyses while ?traits? here correspond to ?species? in such
1999 Jul 01
5
NT Groups
Hi, Im running samba-2.0.4b. Is there a way or granting access to shares using the NT SAM (global groups)? Currently I have to add users to the unix server, then add them to a GID. I hope there is an easier way! Thanks Mark Beck
1999 Aug 19
1
Is there a complete list of options?
Is there a complete list of the configuration options available for samba? A W3 search for samba returns every mirror and the home page, none of which seem to document some of the more obscure options available in samba. Reading the lists I see all types of config's with options that aren't in the docs. Help, anyone? Thanks, Jim
2004 Jan 08
1
Using split.screen
I want to draw a figure with several panels of unequal size, so i thought I would try using screen(). However, I can't figure out how to define the sizes as a matrix. I've tried this: split.screen(matrix(c(0,0.5,0,0.5, 0.5,1,0.5,1), byrow=F, ncol=4)) and a couple of variants on it, but get the same error: Error in par(.split.screens[[cur.screen]]) : invalid value specified
2004 Mar 18
2
character -> list
Hi I have a matrix of type "character" (strangly) and am trying to apply the function "aggregate" to it, but unfortunately without success. It seems to me that aggregate would work, if I only could get rid of the quotation marks around each item. So for a very simple example which looks as my actual data look (of course here I put the quotation marks on purpose, but I have
2012 Nov 08
2
Formatting digits in a table with mix of numbers and characters
Hello, I am currently trying to find an easy way to take a table with a mix of numbers and characters and format the numbers in the table to be constrained to 4 significant digits. Example: #this is my table creation > table <- matrix(c(12.34567, "--", 10, 12.34567, "--", "NA", "--", 123.45678, "--"), ncol = 3, byrow=TRUE) > > table
2010 Jul 29
3
help splitting a data frame
Hi All, I have a dataset that I would like to split based on : or ? ( the data file is tab delimited) for example: Ny:23-45 AC BA:88-91 DB KJ:21-13 PA And I would like the data to be splitted and the final results look like NY 23 45 AC BA 88 91 DB KJ 21 13 PA I would like to have the resulting data as a data frame so each column is a variable. Thanks, -- View this message in context:
2009 May 07
1
extending strsplit to handle missing text that doesn't have the target on which to split
I am sure there is an obvious answer to this that I'm missing but I can't find it. I'm parsing headers of Emails and most have a date like this: "Wed, 16 Nov 2005 05:28:00 -0800" and I can parse that using: tmp.dat.data <- matrix(unlist(strsplit(headers$Date.line,",")), ncol = 2, byrow = TRUE) before going on to look at the day and date/time data.
2007 Apr 20
4
Change the mode of a list
Hello, can anybody tell me a easy way to change the mode of an "aggregate list" to "numeric"? I found a solution but I looks cruel. Thank's Felix PS: In the past you have asked what I am doing. I have to evaluate measures of two gauges of our university. The aim is to get an answer which one is better. > mode(MEAN) [1] "list" > mode(MEASURE) [1]
2010 Jun 25
1
Accessing matrix elements within a list
Hi there, I cannot seem to figure out how to access the elements of a list if those elements are a matrix. For example I have a the following list df.list <- vector("list", 3) and I have made each of the elements a matrix as follows for(i in 1:3){ assign(paste("s",i, sep=""),matrix(0, nrow = 20, ncol = 5, byrow = FALSE, dimnames = NULL)) } # and then insert
2010 Sep 21
3
How to convert a character into a filename?
Dear list, How to convert a character to a filename? such as: x <- "height" # "height" here is actually a name of a colume in a data frame filename <- paste("plant,x") write.csv (data, file="C:/plant/filename.csv) # having trouble with this statement, how to 'write' the filename here? All I want from above is to write 'data' to a file
2010 Jan 31
1
How to split data frame into groups by a list of factors?
Dear R users: I am dealing a data frame x as followings: Date trade_day IV.b IV.a 1 2003-03-02 19 0.1724818 0.1815687 2 2003-03-02 18 0.1733542 0.1763827 3 2003-03-02 19 0.1753308 0.1783653 4 2003-03-03 16 0.1751217 0.1781624 5 2003-03-03 16 0.1738580 0.1768961 6 2003-03-03 19 0.1733346 0.1763800 ...... I want to split the data flame
2010 Aug 03
2
subset based on column names and then subset based on the inverse (grep?, or...)
I would like to be able to grab x and y columns out of a dataframe and then grab all of the columns that are not equal to x or y. I am sure that I am missing something easy. ftbr_UTM_downstream <- (structure(list(site = c("Jennie_Creek_Main_Stem", "Wolf_Pit_Creek_Main_Stem", "Little_Rockfish_Main_Stem_North", "Big_Muddy_Creek_Main_Stem",
2011 Mar 31
2
Linear Model with curve fitting parameter?
I have a model Q=K*A*(R^r)*(S^s) A, R, and S are data I have and K is a curve fitting parameter. I have linearized as log(Q)=log(K)+log(A)+r*log(R)+s*log(S) I have taken the log of the data that I have and this is the model formula without the K part lm(Q~offset(A)+R+S, data=x) What is the formula that I should use? Thanks for all of your help. I can provide a subset of data if necessary.
2003 Jul 08
3
Characters and Numeric Values in One Matrix
Dear R-Users, I want to ask a question for a colleague of mine. He wants to put a character vector and a numeric vector into one matrix and still have the old character and numeric type for the respective columns. Unfortunately, I am just starting using R and I could not help him. Is there an easy and straightforward way to do this in R? Maybe a little example facilitates understanding our
2007 Sep 27
2
create data frame(s) from a list with different numbers of rows
# Hello, # I have a list with 6 categories and with different numbers of rows. # I would like to change each of them into a unique data frame in order to match # values with other data frames and perform some calculations. # Or I could make each category or list element have the same number of rows and create one large data.frame. # below is a creation of a sample list # I apologize for the