similar to: read.table error

Displaying 20 results from an estimated 3000 matches similar to: "read.table error"

2010 Mar 05
2
How to assign week numbers to a time-series
Hello everyone, My progress has stalled on finding a way of creating a somewhat complicated variable to add to my existing dataframe and I am hoping one of you could help me out. The dataframe below contains only a fraction of the data of my complete dataframe, but all of the variables. What I want to do is add another variable named 'WEEK' to this dataframe that is assigned 1 for row 1
2010 Mar 25
4
Creating dataframe of all possible variable combinations
Hello, I need to create a dataframe containing all possible combinations of three variables: SITE (101,102,103,104), WDAY (MON,TUE,WED,THR,FRI), and TOD (MORN, AFTN). There should be a total of 40 unique combinations in my dataframe. I used expand.grid() successfully(?) to create my dataframe, but then when I went to order it by SITE, the resultant dataframe only contained four rows, one for each
2011 Jun 14
0
sqlFetch and factor conversion
R users, Hello, I used sqlFetch to import a data table from MS Access 2007 and I set as.is = TRUE to prevent character vectors from becoming factors. However, I can't figure out how to prevent the $ operator from being added by sqlFetch to the end of each character vector(e.g. TD$ and SITE$). This causes subsequent parts of my code not to work and also results in some behavior that I
2011 Feb 10
1
Conditional sampling
R experts, I need to sample two rows without replacement from the following data frame such that neither row contains the same 'DOW'. For example, I cannot select both a Monday morning and a Monday afternoon. I am using STRATA_NUM as an index to randomly select rows from, since this variable indexes all unique permutations of DOW, SITE, and TOD. I know how to use the sample function
2025 Mar 27
1
Problem with minimization that I failed to understand
My code is to minimize the objective function therefore, shouldnt I expect that StartingValue = c(0.12, 0.04, 0.07, 0.03, 0.06, 0.07, 0.07, 0.04, 0.09, 0.08, 0.02, 0.02, 0.03, 0.06, 0.02, 0, 0.07, 0.05, 0.02, 0.02, 0.02) Fn(q1$par) < Fn(StartingValue) ## FALSE Below is the corrected code that can be reproduced: MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L, 25L,
2025 Mar 27
1
Problem with minimization that I failed to understand
?s 19:36 de 27/03/2025, Daniel Lobo escreveu: > My code is to minimize the objective function > > therefore, shouldnt I expect that > > StartingValue = c(0.12, 0.04, 0.07, 0.03, 0.06, 0.07, 0.07, 0.04, 0.09, > 0.08, 0.02, 0.02, 0.03, 0.06, 0.02, 0, 0.07, 0.05, 0.02, 0.02, 0.02) > Fn(q1$par) < Fn(StartingValue) > ## FALSE > > Below is the corrected code that can
2025 Mar 27
1
Problem with minimization that I failed to understand
?s 18:35 de 27/03/2025, Daniel Lobo escreveu: > Hi, > > I have below minimization problem > > > MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L, > 25L, 50L, 50L, 75L, 75L, 75L, 0L, 75L, 75L, 75L, 0L, 25L, 75L, > 75L, 0L, 75L, 100L, 0L, 25L, 100L), c(75L, 0L, 0L, 50L, 100L, > 50L, 75L, 75L, 100L, 25L, 0L, 25L, 100L, 0L, 50L, 0L, 25L, 25L, >
2025 Mar 27
2
Problem with minimization that I failed to understand
Hi, I have below minimization problem MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L, 25L, 50L, 50L, 75L, 75L, 75L, 0L, 75L, 75L, 75L, 0L, 25L, 75L, 75L, 0L, 75L, 100L, 0L, 25L, 100L), c(75L, 0L, 0L, 50L, 100L, 50L, 75L, 75L, 100L, 25L, 0L, 25L, 100L, 0L, 50L, 0L, 25L, 25L, 100L, 75L, 0L, 0L, 0L, 50L, 0L, 75L, 75L, 0L, 50L, 25L), c(50L, 0L, 0L, 0L, 100L, 25L, 0L, 0L,
2025 Mar 28
1
Problem with minimization that I failed to understand
I haven't run your code, but since Kendall correlation is based on ranks, your Fn is probably locally constant with jumps when the ranks change. That's a really hard kind of function to maximize, and the algorithm used by fmincon is not appropriate to do it. Sorry, but I don't know if there is an R function that can do constrained discrete maximization. Duncan Murdoch On
2025 Mar 28
3
Problem with minimization that I failed to understand
Hi Duncan, Thanks for your comment, I agree with that. But, how it can be justified that an Optimizer gives a result which is inferior to the starting value? At most, resulting value can remain at the same level, isnt it? On Fri, 28 Mar 2025 at 14:34, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > I haven't run your code, but since Kendall correlation is based on >
2025 Mar 28
1
Problem with minimization that I failed to understand
?s 13:59 de 28/03/2025, Daniel Lobo escreveu: > Hi Duncan, > > Thanks for your comment, I agree with that. > > But, how it can be justified that an Optimizer gives a result which is > inferior to the starting value? At most, resulting value can remain at the > same level, isnt it? > > On Fri, 28 Mar 2025 at 14:34, Duncan Murdoch <murdoch.duncan at gmail.com>
2018 May 28
3
How to generate a conditional dummy in R?
Hi everyone, I am trying to generate a conditional dummy variable ?X" with the following rules set X=1 if Y is =1, two years prior to the NA. [0,0,NA]. For example, if the pattern for Y is 0,0,NA then the X variable is =0 for all the two years prior to the NA. If the pattern for Y is 0,1,NA or 1,0,NA then the X =1 . To be clear, if 1,1,NA then the X=1 that first specific year, it
2018 May 29
0
How to generate a conditional dummy in R?
Hi Faradj, What a problem! I think I have worked it out, but only because the result is the one you said you wanted. # the sample data frame is named fkdf Y2Xby3<-function(x) { nrows<-dim(x)[1] X<-rep(0,nrows) for(i in 1:(nrows-2)) { if(!is.na(x$Y[i])) { if(x$Y[i] == 1 && any(is.na(x$Y[(i+1):(i+2)]))) X[i]<-1 if(i > 1) { if(X[i-1] == 1) X[i]<-0 } }
2018 May 29
1
How to generate a conditional dummy in R?
Dear Jim, wow! It worked! Thanks a lot. I did as you suggested and it worked well with the real data. Although it gave me this error: Error in if (!is.na(x$Y[i])) { : argument is of length zero. For some reason the X1 produced less observations than it is in the data. But it's not a big deal - I identified those cases and simply deleted from the data (it was countries that only appeared
1997 Apr 22
0
2.2-970422-RELENG on ftp.freebsd.org (and about SNAP CDs..)
As many of you probably already know, a "SNAP" release is built once per day on the RELENG_2_2 branch (where 2.2.1 came from and from where future 2.2.x releases will be derived) and put up for anonymous FTP at: ftp://releng22.freebsd.org/pub/FreeBSD Since this site isn't always the easiest to get to or mirror, I will also periodically copy "known good" release snapshots
1997 Jul 13
0
CVSup Brazil mirror site
I'm happy to announce a new CVSup mirror site "CVSup.br.FreeBSD.org", located in Brazil. It offers the entire FreeBSD CVS repository, as well as the FreeBSD web page data. Many thanks to Joao Carlos Mendes Luis and Rodolfo Heitor Gevaerd de Faria for making this service available! -- John Polstra jdp@polstra.com John D. Polstra &
2010 Apr 20
5
Assigning Week Numbers
R experts, How could I extract the week number from a date vector (in Date class) such that week numbering (week 1...2...) begins (May 01) and ends (October 31) on the same specific dates each year? Week numbering must conform to the following day numbering format (Sat=1,Sun=2,Mon=3.....Fri=7). This means that new weeks must begin on Saturdays, and end on Fridays (except for the first date
2008 Sep 26
2
bar and line plot
Hello All: Using the below dataset how can I make a barplot with Date(X) and NumEggs(Y) by Site. Then plot Temp(lineplot) It seems really simple, but I am having a hard time trying to do it by Site. Thanks Date NumEggs Site Temp 1 2008-04-22 0 Massacre Flat (RK424.5) 51.20 2 2008-04-23 0 Massacre Flat (RK424.5) 50.80 3 2008-04-24
2007 Apr 12
1
zoo merge() method
R users: I'd like to get some insight on an error I encounter when attempting to work with two moderately sized sets of time series data. FYI - I'm using the following versions of R and supporting packages on a Windows 2000 OS: - R version 2.4.1 (2006-12-18) - zoo version 1.2-2 - chron version 2.3-10 The two time series I'm working with are from the summer of 2004 and are: 1.)
2013 Feb 01
2
Summary of data for each year
Hello All, I have a data with two columns. In one column it is date and in another column it is flow data. I was able to read the data as date and flow data. I used the following code: creek <- read.csv("creek.csv") library(ggplot2) creek[1:10,] colnames(creek) <- c("date","flow") creek$date <- as.Date(creek$date, "%m/%d/%Y") The link to my data