similar to: using "eval(parse(text)) " , gsub(pattern, replacement, x) , to process "code" within a loop/custom function

Displaying 20 results from an estimated 3000 matches similar to: "using "eval(parse(text)) " , gsub(pattern, replacement, x) , to process "code" within a loop/custom function"

2010 Feb 01
3
Convert a column of numbers to a column of strings
Hello, Please excuse me if this question has been asked before. I'm new to R, and have been trying to google the answers without any success. I would like to convert a set of date and time into R date-time class. Right now, the dates and times are in integer format, so I first need to convert them into string, and then to R date-time using strptime. However, I have a problem converting them
2012 Dec 17
1
subset handling
Dear Rui and UseRs,[a text file has also been attached, in case the format of my email is difficult to get]I am extremely sorry that I am bothering you once again, but I?ll have to get to the bottom of it. The following command sp <- lapply(split(agg, agg$st), function(x) x[order(x$year, x$month), ]) gave me an output with monthly mean of population(as under). i am not able to apply
2008 Oct 14
6
Doing a Task Without Using a For Loop
Assume that I have the dataframe "data1", which is listed at the end of this message. I want count the number of lines that each person has for each year. For example, the person with ID=213 has 15 entries (NinYear) for 1953. The following bit of code calculates NinYear: for (i in 1:length(data1$ID)) { data1$NinYear[i] <- length(data1[data1$Year==data1$Year[i] &
2013 Apr 08
2
How can I extract part of the data in a panel dataset?
Taking the Grunfeld data, which is built-in in R, for example, (1)How can I construct a dataset (or dataframe) that consists of the data of all firms in 1951? (2)How can I calculate the average capital in each form over the period 1951-1954? What I can imagine is to categorize the data by firm, and then select the data between 1951 and 1954 for each firm, but how can I do it? Thanks, Miao
2008 Nov 04
1
perform Kruskal-Wallis test without using the built-in command in R
Hi, again i am stuck in my presentation, and i have never learn R before in my life but need this to be done, so please help me out for a favour: http://www.nabble.com/file/p20333155/kew.dat kew.dat run this in R and these comes up: Month Year Rain 1 Jan 1900 74.400000 2 Feb 1900 80.500000 3 Mar 1900 23.600000 4 Apr 1900 23.600000 5 May 1900 25.100000 6
2011 Jul 26
2
How to use as.Date (or something else) with "31-Jul-2010 23:59:00"
Hello I have a huge file (not an R-file) in which the first column is a string with date, hour, minutes and seconds (For instance, "31-Jul-2010 23:59:00"). I tried as.Date but the error msg was "Error in charToDate(x) : character string is not in a standard unambiguous format". I have checked the help for the function as well as date but to no avail. How can that sort
2011 Jul 22
1
Mean and Timeseries modelling
Hello, i have following problem and I hope you can help me a little bit My dataframe looks like: df a m d typ value 1950 1 1 5 -4.1 1950 1 2 9 2.7 1950 1 3 3 -1.3 1950 1 4 5 -1.9 1950 1 5 2 0.2 1950 1 6 8 0.5 1951 1 1 4 1.3 .... It consists by daily observations from 1950- 2009. Now, I get with.... for (i
2011 Nov 03
2
query about counting rows of a dataframe
Dear R users, I have got the following data frame, called my_df: gender day_birth month_birth year_birth labour 1 F 22 10 2001 1 2 M 29 10 2001 2 3 M 1 11 2001 1 4 F 3 11
2012 Dec 04
4
partial analisys of a time series
Dear list members I want to analyze separately the months of a time series. In other words, I want to plot and fit models for each month separately. Taking the example of http://a-little-book-of-r-for-time-series.readthedocs.org/en/latest/src/timeseries.html births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat") birthstimeseries <- ts(births, frequency=12,
2008 Mar 31
5
[LLVMdev] Additional Optimization I'm Missing?
Hello, I'm working on using the LLVM JIT for a little project of mine, amazing work first off! I have a question about optimization passes. I initially have this function I've created, in python it looks like this: OS_end = 50OS_start = 0OS_timestep = 1birth_rate = .3population = 30.0for time in range(OS_start, OS_end, OS_timestep): births = birth_rate * population deaths = 0.1
2007 Oct 26
1
finding birth position
Hi All, I have data on the sequence of births for families with completed fertility cycle (in a data frame); the relevant variables are called b1, b2, b3, b4, b5, b6 and record the birth of the first, second, ..., sixth child. So, b1=1 if the first birth is male, b1=2 if the first birth is female, and b1=NA if the family did not record any first birth. Similarly for b2, b3, b4, b5 and b6. I
2009 Apr 22
1
converting histogram to barchart
Hi list, After a lot of tweaking i have managed to create a histogram with an overlaying density plot. The histogram shows a sample of birth weights of babies and the density plot shows birth weights from a much larger reference populaton. My data is divided in 0.1 Kg bins so in the code below binweigh=0.1. The trouble with the current graph is that it is not very clear since the density plot
2013 Mar 12
5
extract values
Hello all! I have a problem to extract values greater that for example 1820. I try this code: x[x[,1]>1820,]->x1 Please help me! Thank you! The data structure is: structure(c(2.576, 1.728, 3.434, 2.187, 1.928, 1.886, 1.2425, 1.23, 1.075, 1.1785, 1.186, 1.165, 1.732, 1.517, 1.4095, 1.074, 1.618, 1.677, 1.845, 1.594, 1.6655, 1.1605, 1.425, 1.099, 1.007, 1.1795, 1.3855, 1.4065, 1.138, 1.514,
2013 Mar 13
2
merge datas
Hello all! I have a problem with R. I try to merge data like this: structure(c(2.1785, 1.868, 2.1855, 2.5175, 2.025, 2.435, 1.809, 1.628, 1.327, 1.3485, 1.4335, 2.052, 2.2465, 2.151, 1.7945, 1.79, 1.6055, 1.616, 1.633, 1.665, 2.002, 2.152, 1.736, 1.7985, 1.9155, 1.7135, 1.548, 1.568, 1.713, 2.079, 1.875, 2.12, 2.072, 1.906, 1.4645, 1.3025, 1.407, 1.5445, 1.437, 1.463, 1.5235, 1.609, 1.738, 1.478,
2009 Jan 10
1
Plot link points
Hi. This may be a straight-forward question... I have a time series from 1950 to 2000 (by year) with missing values. Sometimes only a year has value and the adjacent years have missing data, e.g. 1950 2.7 1951 1952 1953 3.4 1954 1955 1956 2.9 1957 3.6 1958 2.7 When I use plot (type='l'), the line can't connect the 'stand-alone' years. Is there a way I have have R to skip
2008 Feb 07
5
"revision control software" for managing R-code?
Does anyone use "revision control software" to manage their R-code? Any suggestions? Ideally, I'm looking for a, effective yet easy to implement/maintain package. http://en.wikipedia.org/wiki/Revision_control http://en.wikipedia.org/wiki/Comparison_of_revision_control_software --------------------------------- [[alternative HTML version deleted]]
2002 Aug 27
1
ts basic question
Dear R collegues, I'd like to use the time-series facilities of R and I'm not sure how to set my dataset properly. I have monthly data, so the description could be: ts(data, start=c(1951,1), frequency= 12) However, the data is a matrix of years (rows) and months (columns), as follows: > s1 <- read.table("stdata.txt", header=TRUE) > s1[1:3, ] YEAR JAN FEB MAR APR
2013 Apr 07
2
group data in classes
Hello all! I have a problem to group my data (years) in 10 years classes. For example for year year decade 1598 1590-1600 1599 1590-1600 1600 1590-1600 1601 1600-1610 --- my is like this> [1] 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 [16] 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 [31] 1628 1629 1630 1631 1632 1633
2005 Jun 14
2
Plotting rows (or columns) from a matrix in different graphs, not using "par"
Dear R-users, I would like to ask whether it's possible (for sure it would be), to plot each rows (or columns) in different graphs and in the same figure region without using the function "par" and then struggling around with "axes" and labels etc. Luckily, I would always have "rows + columns = even number" and the same "ylim". The next one could be a
2012 Jul 02
3
enquiry
hi, i am new to using r .so if you can pls tell me how to read "1951-52" ,"1952-52" date format in r [[alternative HTML version deleted]]